Sensor auto-calibration

ABSTRACT

Aspects of the disclosure relate to computing technologies. In particular, aspects of the disclosure relate to mobile computing device technologies, such as systems, methods, apparatuses, and computer-readable media to improve the calibration data by taking into account the effects of change in temperature on motion sensors. For instance, different levels of error may be associated with a motion sensor at different temperature levels. In one implementation, the sensor measurement data associated with the various orientations at a temperature is used in determining the calibration data for that temperature.

CROSS-REFERENCE TO RELATED APPLICATIONS

This patent application claims the benefit of U.S. Provisional PatentApplication No. 61/559,030, filed Nov. 11, 2011, entitled “ACCELEROMETERAUTO-CALIBRATION,” all of which is incorporated by reference herein inits entirety for all purposes.

BACKGROUND

Aspects of the disclosure relate to computing technologies. Inparticular, aspects of the disclosure relate to mobile computing devicetechnologies, such as systems, methods, apparatuses, andcomputer-readable media that automatically calibrate one or moreaccelerometers and/or one or more other sensors, such as motion sensors,magnetometers, gyroscopes, and/or the like.

Increasingly, computing devices, such as smart phones, tablet computers,personal digital assistants (PDAs), and other mobile devices, includeaccelerometers and/or other motion sensors that may allow these devicesto capture motion and/or other sensed conditions as a form of userinput. As the inclusion of accelerometers and/or other motion sensors incomputing devices becomes more common, the ways in which the computingdevices process and/or otherwise use the motion information provided bysuch accelerometers and/or other motion sensors likewise becomes moresophisticated. Aspects of the disclosure provide more convenient andeffective ways of enhancing how the information provided byaccelerometers and/or other motion sensors can be interpreted and/orotherwise processed by a computing device, for instance, by providingways of automatically calibrating accelerometers and/or other motionsensors.

BRIEF SUMMARY

According to one or more aspects of the disclosure, a computing devicemay automatically capture sensor measurements in response to detecting apassive calibration action. Subsequently, the computing device may storeinformation about a position at which the sensor measurements werecaptured. Thereafter, the computing device may update one or morecalibration parameters based on the automatically captured sensormeasurements and the stored information.

Embodiments of the invention describe techniques for scheduling anexecution of a task, such as a non-real time background task on acomputing device. In one implementation, the technique includesdetecting a first state of a device, wherein the first state of thedevice is associated with a first power level and a first task,determining that the first power level associated with the first stateis above a threshold, and in response to determining that the firstpower level associated with the first state is above the threshold, andscheduling an execution of a second task on the device. It may beadvantageous to execute the non-real time, non-latency sensitivebackground task while the device is in a high power state, to avoidconsuming power and keeping the device in an elevated power state whenno other tasks are running. The power state of the device may bedetermined by measuring the consumed power, detecting the state of thecomputing device, detecting the power state of the device using hardwaremechanisms or by any other suitable means. Collecting calibration dataon the computing device is an example of a non-real time backgroundtask. In one embodiment, the computing device may schedule thecollection of calibration data for motion sensors while the device isalready in an active state, thus efficiently utilizing power.

Another embodiment of the invention describes techniques for improvingthe calibration data by increasing the diversity of orientations usedfor generating calibration data. In one embodiment, the computing devicereceives a plurality of calibration measurements, determines a degree towhich the plurality of calibration measurements were captured atdifferent orientations, and determines, based on the degree, whether toupdate one or more calibration parameters. In one implementation,determining the degree to which the plurality of calibrationmeasurements were captured at different orientations comprisescalculating an orientation entropy value for the plurality ofmeasurements.

In yet another embodiment, techniques are described herein to improvethe calibration data by taking into account the effects of change intemperature on motion sensors. For instance, different levels of errormay be associated with a motion sensor at different temperature levels.In one implementation, the calibration data associated with the variousorientations at a temperature is used to determine the calibration datafor that temperature. In this embodiment, the computing device maydetect the temperature of an operating environment for a sensor coupledto a computing device, may determine that an entropy/diversityassociated with the stored measurement data at or near the temperatureis below a threshold, in response to determining that the entropyassociated with the stored calibration data for the temperature is belowa threshold, interpolate calibration data for an at least oneorientation at the detected temperature using calibration data for theat least one orientation from another temperature, and generatecalibration data for the sensor for the detected temperature using atleast the interpolated calibration data.

An exemplary method for generating calibration data may includedetecting temperature of an operating environment for a sensor coupledto a device, determining that diversity associated with sensormeasurement data at or near the temperature is below a threshold, and inresponse to determining that the diversity associated with the sensormeasurement data at or near the temperature is below the threshold,generating the calibration data for the sensor for the detectedtemperature using sensor measurement data from another temperature. Thesensor may be one or more of an accelerometer, a gyroscope or amagnetometer.

In one implementation, the method may further comprise identifying atemperature bin from a plurality of temperature bins for the sensorusing the detected temperature, in response to detecting temperature ofan operating environment for the sensor, wherein the temperature bincomprises a range of temperatures. The temperature bin may have one ormore sensor measurements received at a temperature within the range oftemperatures associated with the temperature bin. The generating ofcalibration data may include using sensor measurement data from anothertemperature bin. The method may further comprise lowering a weightassociated with the sensor measurement data from another temperature binby adjusting one or more parameters of a filter associated with thetemperature bin. In another implementation generating may compriselinearly interpolating sensor measurement data for at least oneorientation at the temperature bin for the detected temperature usingthe sensor measurement data from one or more adjacent temperature binsto the identified temperature bin. Furthermore, linearly interpolatingsensor measurement data may comprise using the sensor measurement fromone or more adjacent temperature bins and a pre-determined slope of achange in sensor measurement data with respect to a change intemperature for deriving the sensor measurement data for the at leastone orientation at the temperature bin.

In one aspect, each temperature bin may be associated with a respectivefilter. The method may further comprise updating the sensor measurementdata for at least one orientation at the detected temperature using thesensor measurement data from another temperature. In some embodiments,the calibration data may comprise a sensor offset or an associatedsensitivity. In one embodiment, generated calibration data for thesensor for the detected temperature may be used for calibrating outputfrom the sensor at or near the temperature.

An exemplary device, wherein components of the device, such as thetemperature compensation model may be configured for generatingcalibration data and include detecting temperature of an operatingenvironment for a sensor coupled to a device, determining that diversityassociated with sensor measurement data at or near the temperature isbelow a threshold, and in response to determining that the diversityassociated with the sensor measurement data at or near the temperatureis below the threshold, generating the calibration data for the sensorfor the detected temperature using sensor measurement data from anothertemperature. The sensor may be one or more of an accelerometer, agyroscope or a magnetometer.

In one implementation, components of the device, such as the temperaturecompensation module, may further comprise identifying a temperature binfrom a plurality of temperature bins for the sensor using the detectedtemperature, in response to detecting temperature of an operatingenvironment for the sensor, wherein the temperature bin comprises arange of temperatures. The temperature bin may have one or more sensormeasurements received at a temperature within the range of temperaturesassociated with the temperature bin. The generating of calibration datamay include using sensor measurement data from another temperature bin.The temperature compensation module may further comprise lowering aweight associated with the sensor measurement data from anothertemperature bin by adjusting one or more parameters of a filterassociated with the temperature bin. In another implementationgenerating may comprise linearly interpolating sensor measurement datafor at least one orientation at the temperature bin for the detectedtemperature using the sensor measurement data from one or more adjacenttemperature bins to the identified temperature bin. Furthermore,linearly interpolating sensor measurement data may comprise using thesensor measurement from one or more adjacent temperature bins and apre-determined slope of a change in sensor measurement data with respectto a change in temperature for deriving the sensor measurement data forthe at least one orientation at the temperature bin.

In one aspect, each temperature bin may be associated with a respectivefilter. The device may be further configured for updating the sensormeasurement data for at least one orientation at the detectedtemperature using the sensor measurement data from another temperature.In some embodiments, the calibration data may comprise a sensor offsetor an associated sensitivity. In one embodiment, generated calibrationdata for the sensor for the detected temperature may be used forcalibrating output from the sensor at or near the temperature.

An exemplary non-transitory computer readable storage medium, whereinthe non-transitory computer readable storage medium comprisesinstructions executable by a processor, the instructions comprisinginstructions to detect temperature of an operating environment for asensor coupled to the device, determine determining that diversityassociated with sensor measurement data at or near the temperature isbelow a threshold; and generate the calibration data for the sensor forthe detected temperature using sensor measurement data from anothertemperature, in response to determining that the diversity associatedwith the sensor measurement data at or near the temperature is below thethreshold.

An exemplary apparatus for generating calibration data may include meansfor detecting temperature of an operating environment for a sensorcoupled to a device, means for determining that diversity associatedwith sensor measurement data at or near the temperature is below athreshold, and in response to determining that the diversity associatedwith the sensor measurement data at or near the temperature is below thethreshold, means for generating the calibration data for the sensor forthe detected temperature using sensor measurement data from anothertemperature. The sensor may be one or more of an accelerometer, agyroscope or a magnetometer.

In one implementation, the apparatus may further comprise means foridentifying a temperature bin from a plurality of temperature bins forthe sensor using the detected temperature, in response to detectingtemperature of an operating environment for the sensor, wherein thetemperature bin comprises a range of temperatures. The temperature binmay have one or more sensor measurements received at a temperaturewithin the range of temperatures associated with the temperature bin.The generating of calibration data may include using sensor measurementdata from another temperature bin. The apparatus may further comprisemeans for lowering a weight associated with the sensor measurement datafrom another temperature bin by adjusting one or more parameters of afilter associated with the temperature bin. In another implementationgenerating may comprise means for linearly interpolating sensormeasurement data for at least one orientation at the temperature bin forthe detected temperature using the sensor measurement data from one ormore adjacent temperature bins to the identified temperature bin.Furthermore, linearly interpolating sensor measurement data may comprisemeans for using the sensor measurement from one or more adjacenttemperature bins and a pre-determined slope of a change in sensormeasurement data with respect to a change in temperature for derivingthe sensor measurement data for the at least one orientation at thetemperature bin.

In one aspect, each temperature bin may be associated with a respectivefilter. The apparatus may further comprise means for updating the sensormeasurement data for at least one orientation at the detectedtemperature using the sensor measurement data from another temperature.In some embodiments, the calibration data may comprise a sensor offsetor an associated sensitivity. In one embodiment, generated calibrationdata for the sensor for the detected temperature may be used forcalibrating output from the sensor at or near the temperature.

The foregoing has outlined rather broadly features and technicaladvantages of examples in order that the detailed description thatfollows can be better understood. Additional features and advantageswill be described hereinafter. The conception and specific examplesdisclosed can be readily utilized as a basis for modifying or designingother structures for carrying out the same purposes of the presentdisclosure. Such equivalent constructions do not depart from the spiritand scope of the appended claims. Features which are believed to becharacteristic of the concepts disclosed herein, both as to theirorganization and method of operation, together with associatedadvantages, will be better understood from the following descriptionwhen considered in connection with the accompanying figures. Each of thefigures is provided for the purpose of illustration and description onlyand not as a definition of the limits of the claims.

BRIEF DESCRIPTION OF THE DRAWINGS

Aspects of the disclosure are illustrated by way of example. Thefollowing description is provided with reference to the drawings, wherelike reference numerals are used to refer to like elements throughout.While various details of one or more techniques are described herein,other techniques are also possible. In some instances, well-knownstructures and devices are shown in block diagram form in order tofacilitate describing various techniques.

A further understanding of the nature and advantages of examplesprovided by the disclosure can be realized by reference to the remainingportions of the specification and the drawings, wherein like referencenumerals are used throughout the several drawings to refer to similarcomponents. In some instances, a sub-label is associated with areference numeral to denote one of multiple similar components. Whenreference is made to a reference numeral without specification to anexisting sub-label, the reference numeral refers to all such similarcomponents.

FIG. 1 illustrates an example device that may implement one or moreaspects of the disclosure.

FIG. 2 illustrates another example device that may implement one or moreaspects of the disclosure.

FIGS. 3A and 3B illustrate examples of how device orientation may affectacceleration vectors according to one or more illustrative aspects ofthe disclosure.

FIG. 4 illustrates an example of a system that implements variousaspects of the disclosure.

FIG. 5 illustrates an example method of automatically calibrating atleast one accelerometer according to one or more illustrative aspects ofthe disclosure.

FIG. 6 is a simplified flow diagram illustrating a non-limiting examplefor scheduling collection of calibration data.

FIG. 7 is a timing diagram illustrating an exemplary implementation forextending the window for collecting calibration data in anticipation oforientations of the computing device associated with high qualitycalibration data.

FIG. 8 is a simplified flow diagram illustrating a non-limiting methodperformed by embodiments of the invention for scheduling an execution ofa task on a computing device.

FIG. 9 illustrates exemplary components of the calibration moduleaccording to one or more illustrative aspects of the disclosure.

FIG. 10 illustrates an example method of updating calibration parametersusing a feedback loop according to one or more illustrative aspects ofthe disclosure.

FIG. 11 illustrates a non-limiting example method of evaluatingcalibration measurements using orientation entropy according to one ormore illustrative aspects of the disclosure.

FIG. 12 illustrates a non-limiting example method of evaluatingcalibration measurements using frequency binning according to one ormore illustrative aspects of the disclosure.

FIG. 13 is a simplified flow diagram illustrating a non-limiting methodperformed by embodiments of the invention for scheduling an execution ofa task on a computing device.

FIGS. 14A-14C illustrate various aspects of the example calibrationmethod in greater detail according to one or more illustrative aspectsof the disclosure.

FIG. 15 illustrates an example of a Kalman Filter according to one ormore illustrative aspects of the disclosure.

FIG. 16 is a simplified flow diagram illustrating a non-limiting methodperformed by the temperature compensation module of the computingdevice.

FIG. 17 is a simplified flow diagram illustrating a non-limiting methodperformed by the temperature compensation module of the computing devicefor updating the temperature compensation look-up table with sensorcalibration information.

FIG. 18 is a simplified flow diagram illustrating a non-limiting methodperformed by the temperature compensation module of the computing device2000 for generating calibration data for a temperature.

FIG. 19 illustrates an example method of compensating for cross-axissensitivity due to manufacturing defects.

FIG. 20 illustrates an example of a computing system in which one ormore embodiments may be implemented.

DETAILED DESCRIPTION

Several illustrative embodiments will now be described with respect tothe accompanying drawings, which form a part hereof. While particularembodiments, in which one or more aspects of the disclosure may beimplemented, are described below, other embodiments may be used andvarious modifications may be made without departing from the scope ofthe disclosure or the spirit of the appended claims.

I. Overview of Auto-Calibration

FIGS. 1 and 2 illustrate example devices that may implement one or moreaspects of the disclosure and may implement components of the computingdevice 2000 described in more detail with reference to FIG. 20. Asillustrated in FIG. 1, for example, computing device 2000 may includeone or more components such as a display 105, buttons and/or keys 110,and/or a camera 115. In some arrangements, display 105 may be a touchscreen, such that a user may be able to provide touch-based user inputto computing device 2000 via display 105.

In one or more arrangements, computing device 2000 may further include aplurality of internal components, such as those illustrated in FIG. 2.For example, computing device 2000 may include one or more processors(e.g., processor 2010), one or more memory units (e.g., memory 2035), atleast one display adapter (e.g., display adapter 215), at least oneaudio interface (e.g., audio interface 220), one or more camerainterfaces (e.g., camera interface 225), and/or other components.

In one or more embodiments, computing device 2000 may further include aplurality of sensors, such as one or more accelerometers (e.g.,accelerometer 2055), one or more gyroscopes (e.g., gyroscope 2060), oneor more magnetometers (e.g., magnetometer 2065), and/or one or moretemperature sensors (e.g., temperature sensor 2070). Accelerometer 2055may measure and/or provide (e.g., to processor 2010) information aboutacceleration experienced by computing device 2000 and/or otherwisesensed by accelerometer 2055 (e.g., due to electrical interference).Gyroscope 2060 may similarly measure and/or provide (e.g., to processor2010) information regarding an orientation of computing device 2000. Inaddition, magnetometer 2065 may measure and/or provide (e.g., toprocessor 2010) information regarding a bearing of computing device2000, and temperature sensor 2070 may measure and/or provide (e.g., toprocessor 2010) information about a temperature (e.g., an ambienttemperature) experienced by computing device 2000.

According to one or more aspects, any and/or all of the sensors includedin computing device 2000 (e.g., accelerometer 2055) may generate anelectric signal in response to and/or as an output signal correspondingto changes in condition, such as motion detected by a particular sensorwhen the sensor and/or computing device 2000 are moved in one or moredirections. Additionally, or alternatively, because of imperfections inhow such sensors may be manufactured, normal deterioration duringexpected operation, and/or other factors that may create and/orcontribute to inaccuracy in the data output by such sensors over time,it may be desirable to calibrate any and/or all of the sensors includedin computing device 2000 so as to more accurately interpret signalsoutput by such sensors.

As used herein, “calibrating” a sensor may include receiving raw sensormeasurement data (e.g., an electrical signal) output by a sensor, suchas an accelerometer, gyroscope, magnetometer, etc. and applying one ormore scale factors and/or offsets to the raw data to calculate and/orotherwise determine a more accurate representation of motioncorresponding to the received sensor data. The scale factors and offsetsmay independently and/or together be referred to as “calibrationparameters,” and each sensor may have its own corresponding set ofcalibration parameters. In addition, in applying calibration parametersto sensor data, a “scale factor” may be a coefficient or other valuethat is multiplied by received sensor data, and an “offset” may be avalue that is added to the received sensor data.

In many current systems, calibration of sensors, such as accelerometers2055, may be done at the time a computing device 2000 is manufactured(e.g., at the factory). Or, such calibration may be accomplished byprompting the user to manually perform a calibration routine, forinstance, by moving the computing device 2000 through a set of differentpositions allowing for sensor data to be measured and recorded. Both ofthese calibration methods have attendant disadvantages, however. Forinstance, when a sensor, such as an accelerometer 2055, is calibratedonly at a factory at the time the computing device is manufactured, if(and typically when) the quality of data measured by the sensordeteriorates over time, there might not be a way for this deteriorationin the quality of sensor data to be corrected. Additionally, when, forexample, a sensor, such as an accelerometer 2055, is calibrated by auser, the calibration routine, which may require accurate and/orparticular measurements, may itself be subject to user-introducederrors.

By implementing one or more aspects of the disclosure, however, one ormore sensors of a device, such as one or more accelerometers 2055, maybe automatically calibrated during normal use, without prompting a userto perform a calibration routine and/or move the device through a set ofdifferent positions, for instance. Instead, and as further described ingreater detail below, the computing device 2000 may measure and/orcapture information used to calibrate one or more sensors at particulartimes, where the times may correspond to particular activities performedby and/or with the device.

Thus, in calibrating an accelerometer 2055, for example, it may bedesirable to estimate offsets and scale factors that affect theaccelerometer data. Offsets can be modeled as a constant error in theaccelerometer signal, while scale factors can be modeled asmultiplicative constants. Thus, a goal of calibration may be to estimatethese constants from a signal corrupted by noise.

The vector accelerometer signal (e.g., received the signal received fromaccelerometer 2055 by processor 2010) may be modeled asa _(x) =x ₀(1+x _(SF))+x _(OFF)+noise 1a _(y) =y ₀(1+y _(SF))+y _(OFF)+noise 2a _(z) =z ₀(1+z _(SF))+z _(OFF)+noise 3

where a_(x) is accelerometer measurement returned by the sensor, x₀ isthe true acceleration, x_(OFF) is the offset on x-axis and x_(SF) is thedeviation of scale factor (from 1) on x-axis. Similar definitions mayhold for other axes.

Depending on the orientation of the computing device 2000 (which may,for instance, comprise a mobile phone), the offsets and scale factorscan manifest themselves differently on each axis.

FIGS. 3A and 3B illustrate examples of how a computing device 2000orientation may affect acceleration vectors according to one or moreillustrative aspects of the disclosure. For example, as illustrated inFIG. 3A, the z-axis is aligned to gravity, and thus a_(x) and a_(y) areexpected to be 0. Due to the presence of offsets,a _(x) =x _(OFF) and a _(y) =y _(OFF). Note that a _(z) =g(1+z _(SF))+z_(OFF).

As illustrated in FIG. 3B, the computing device 2000 is held such thatthe z-axis is aligned to gravity but upside down. Now,a_(−z)=−g(1+z_(SF))+z_(OFF).

Now, by solving the two equations, the offsets and scale factors can beobtained for the z-axis. These equations are:

$z_{OFF} = \frac{\left( {a_{z} + a_{- z}} \right)}{2}$$z_{SF} = {\frac{\left( {a_{z} - a_{- z}} \right)}{2g} - 1}$

The offsets and scale factors can be computed by solving 2 equations for2 unknowns as described above. The other axes can also be calibratedusing the same methodology by placing the computing device 2000 suchthat the axis of interest is aligned to gravity and then away from it.The presumption that the orientation of the computing device is knowallows for manual or factory calibration.

For auto-calibration, scalar acceleration may be an important concept.Scalar acceleration may be defined as the norm of the accelerometerdata. For example, scalar acceleration may be expressed as:√{square root over (a _(x) ² +a _(y) ² +a _(z) ²)}.

When the computing device 2000 is stationary, and in the absence of anyaccelerometer errors, for any computing device 2000 orientation thescalar acceleration may be equal to gravity, i.e., scalar accelerationmay be expressed as:√{square root over (a _(x) ² +a _(y) ² +a _(z) ²)}=g, where g isgravity.

For a given temperature, both offsets and scale factors can be assumedto be constant. Thus, during stationary periods, any change in thescalar acceleration lengths when compared to gravity can be attributedto the offset and scale factor errors. These noisy estimates of changein accelerometer lengths may be used to compute offsets and scalefactors, by the processor, and may form the basis for auto-calibrationalgorithms.

In one or more calibration algorithms and/or methods described herein,difference between squared scalar acceleration and g² is used as aKalman Filter (KF) measurement, as described in greater detail below. Inaddition, algorithms that rely on scalar acceleration may be independentof device orientation. Several measurements in different orientations(not necessarily orthogonal) may be needed in order to find thecalibration parameters reliably in the presence of noise.

FIG. 4 illustrates an example of a system that implements variousaspects of the disclosure. As seen in FIG. 4, system 400 may be a systemconfigured to perform sensor auto-calibration. In at least onearrangement, system 400 may be implemented as computer-readableinstructions stored on a computer-readable medium, storage 2025 ormemory 2035 that, when executed, cause a computing device to performvarious steps, such as those described below. In another arrangement,system 400 or components of the system 400, such as the schedulingmodule, calibration module and the temperature compensation module maybe implemented as hardware, software, firmware modules or anycombination thereof.

According to one or more aspects, system 400 may include a schedulingmodule 405, a calibration module 410, and a temperature compensationmodule 415. Each of these modules are described in greater detail below.

As an overview, however, in at least one arrangement, scheduling module405 may be responsible for scheduling the calibration and temperaturecompensation modules. The criteria chosen for initiating calibration maybe based on power considerations (e.g., so as to reduce the powerconsumed by the device, such as computing device 2000, in automaticallycalibrating an accelerometer).

Calibration module 410 may include several sub-modules, such as aStationary Detector module, a Feature Creation/Data Pre-processingmodule, a Kalman Filter module, a Feedback Monitor module, and aDecision Monitor module.

In one or more arrangements, temperature compensation module 415 may beresponsible for management of results for each temperature range thatthe sensor operates. For every temperature encountered, one instance ofthe calibration module may be executed. The intermediate results can bestored in a look-up table and read back when the next sample at the sametemperature is encountered.

According to one or more aspects, the modules of system 400 may operatetogether to perform and/or provide automatic sensor calibration. Ahigh-level example of how these modules may operate and/or interact willnow be described:

At the outset, scheduling module 405 may determine whether the computingdevice 2000 is in a high-power mode. Then, if scheduled, the temperaturecompensation module 415 may be activated. For every sensor measurementdata and temperature data pair, two instances of the calibration module410 may be updated, as further described below. One may bin at defaultor ambient temperature (e.g., to speed up convergence at ambient), andthe other may bin at current temperature (e.g., to update the KalmanFilter (KF) for the particular temperature).

Subsequently, for each temperature bin, the sensor measurement (e.g.,acceleration) sample may be passed to the calibration module 410. Thesample may then be checked for stationarity. If it is found to be theend of a stationary period, average acceleration and variance may becomputed in the Feature Creation module. The feature may be passed tothe Kalman Filter, which may iteratively estimate the offsets and scalefactors. If the calibration parameters for a particular temperature aredetected to be reliable by the Decision Monitor, the reliability flagmay be set.

Thereafter, at the end of the calibration module update, the temperaturelook-up table may be updated with the intermediate results or the finalresults along with the reliability flag.

In general, for convergence at each temperature, the Kalman Filter mayneed 100 to 150 reliable positions at every temperature for calibration.Thus, the table may be built over time. The temperatures encounteredoften (e.g., ambient) may have calibration parameters faster. Additionaldetails regarding each of these modules, as well as other aspects ofautomatic accelerometer calibration, will now be described in greaterdetail in the sections that follow.

FIG. 5 illustrates an example method of automatically calibrating atleast one sensor, such as an accelerometer 2055 according to one or moreillustrative aspects of the disclosure. According to one or moreaspects, any and/or all of the methods and/or methods steps describedherein may be implemented by and/or in a computing device, such ascomputing device 2000 and/or the computer system described in greaterdetail below, for instance. In one embodiment, one or more of the methodsteps described below with respect to FIG. 5 are implemented by aprocessor of the computing device 2000, such as the processor 2010 orother processor. Additionally or alternatively, any and/or all of themethods and/or method steps described herein may be implemented incomputer-readable instructions, such as computer-readable instructionsstored on a computer-readable medium such as the memory 2035 or othercomputer-readable medium, internal or external to the computing device2000, as described in greater detail below.

At block 501, a computing device 2000 (e.g., mobile device) mayinitialize and/or load information corresponding to settings and/or userpreferences. In at least one arrangement, such information may includedefault calibration parameters for calibrating one or moreaccelerometers 2055 included in computing device 2000.

At block 502, it may be determined whether a passive calibration actionhas been detected. For example, at block 502, computing device 2000 maydetermine whether a passive calibration action has been detected. Apassive calibration action may, for instance, include any action and/oractivity in which a position and/or orientation of the device may beknown or estimated. For example, a passive calibration action may bedetected when a user concludes a telephone call, at which time it may beknown that the device is held in a user's hand in a certain way and/orlaying flat on a table or other surface. Other possible activitiesand/or actions that may operate as passive calibration actions arefurther described in greater detail below with respect to the schedulingmodule. Performing aspects of the invention in response to detecting thepassive calibration action may be advantageous since the schedulingoccurs opportunistically, e.g. it may occur during natural use by theuser of the computing device without prompting the user to perform aspecific action or place the computing device in a specific orientation.

At block 503, it may be determined whether the device is in ameasurement position. For example, at block 502, computing device 2000may determine whether it is in a measurement position. A measurementposition may refer to and/or include a position where the device isorthogonal to at least one axis. In one or more additional and/oralternative arrangements, a measurement position may refer to and/orinclude any position where the device's orientation may be known withrespect to one or more axes. For instance, the device's orientation withrespect to one or more axes may be known using sensors other than one ormore accelerometers 2055 to be calibrated, such as one or moregyroscopes 2060, one or more magnetometers 2065, one or more otheraccelerometers 2055, and/or the like.

At block 504, measurements may be captured or obtained. For example, atblock 504, computing device 2000 may receive signal input from one ormore accelerometers (e.g., accelerometer 1230). Such signal input maycorrespond to a detected and/or measured amount of acceleration during aparticular time.

At block 505, the measurements may be stored. For example, at block 505,computing device 2000 may store (e.g., in memory 1210) information aboutthe signal received at block 504 from the one or more accelerometers.Such information may include information about the signal's amplitude atone or more points in time, frequency information, and/or otherinformation associated with the signal.

At block 506, information about the position at which the signal wascaptured may be stored. For example, at block 506, computing device 2000may store (e.g., in memory 1210) information regarding the orientationof the device (e.g., in units of degrees), the bearing of the device,and/or other position information about the device corresponding to thetime(s) at which the signal was captured. As described below, thisposition information may subsequently be used in determining aconfidence level for calibration parameters determined based on thesignal (e.g., using orientation entropy and/or frequency binningtechniques, as further described below).

Subsequently, at block 507, one or more calibration parameters may beupdated. For example, at block 507, computing device 2000 may calculateone or more scale factors and/or offset parameters for an accelerometer(e.g., using one or more techniques described in greater detail below),and the calculated scale factors and/or offset parameters may be used toupdate one or more calibration parameters. For instance, the one or morecalculated scale factors and/or offset parameters may simply replacepreexisting scale factors and/or offset parameters. Additionally oralternatively, algorithms may be used, e.g., as further described below,to determine how the one or more calculated scale factors and/or offsetparameters should be combined with and/or be used to modify preexistingscale factors and/or offset parameters.

Thereafter the method may continue to run as a non-real time,non-latency sensitive background process (e.g., computing device 2000may continue to execute the method as a background process) so as tocontinue to gather calibration data and/or apply calibrationadjustments. For example, the method may return to block 502, in whichcomputing device 2000 may again determine whether a passive calibrationaction has been detected. Additionally or alternatively, if it isdetermined at block 502 that a passive calibration action has not beendetected, and/or if it is determined at block 503 that the device is notin a measurement position, then the method again may loop back to step502 and continue to run as a background process.

In this way, the method may allow computing device 2000 to capture moremeasurements and positions over time. Because, as described above, theequations being solved involve two variables (i.e., scale factor andoffset), it may be desirable to capture at least two measurements peraxis so as to solve the system of equations. Moreover, by running themethod as a background process in a looped fashion, e.g., as describedabove, the accuracy of the calibration may improve over time. Inparticular, as the computing device 2000 sees more positions and obtainsmore measurements corresponding to those positions, the calibrationparameters may be based on a larger sampling of measurements andaccordingly may become more accurate. Additionally or alternatively,power savings may be realized by running this method, e.g., incombination with other aspects described herein, such as the schedulingmodule described below, which intelligently selects certain times forobtaining calibration measurements.

II. Scheduling Module

Embodiments of the invention describe scheduling an execution of a taskon a computing device 2000. In some embodiments the task may be anon-real time, non-latency sensitive background task such as calibratingthe sensors coupled to the device. Sensors may include, but are notlimited to accelerometers 2055, gyroscopes 2060, magnetometers 2065,barometers, etc. The task may be scheduled to execute while one or morecomponents of the computing device 2000 are active or in a high powermode, the device battery is charging, or during periods of anticipatedhigh quality data. In one embodiment, the scheduling of the task mayoccur during the high power mode, while the device is charging, orfollowing a triggering event such as ringing/vibration of a phone thatleads to a state with high quality data.

In some implementations, the determination if the computing device 2000is in high power mode is based on the power consumption due to theexecution of tasks during the high power mode. In other implementations,the determination if the computing device 2000 is in high power mode isbased on the determination that the current state is one of a pluralityof states associated with a power level above the threshold. In yetother implementations, the device or components of the device may havedefined power states, such as various sleep states, activity states, lowpower states and high power states. Furthermore, some computing devices2000 may have hardware hooks that allow access to the power state of thecomputing device 2000, facilitating the determination if the computingdevice 2000 is in a high power mode.

In some embodiments of the invention, sensor measurement data from thesensors are captured without prompting a user to place the device in acalibration position or prompting the user to execute a calibrationroutine. Calibration of the sensors coupled to the device may beperformed automatically by the processor 2010. Continuous calibration ofthe sensors, such as accelerometers 2055, gyroscopes 2060, magnetometers2065, barometers, etc., may have considerable implications on powerconsumption of the computing device 2000. In one aspect, the method forcalibrating the sensor coupled to the computing device 2000 may beperformed on an Application processor, DSP processor or any othercomputing module coupled to the computing device 2000. It may beadvantageous to perform the calibration less frequently to conservepower. For example, continuously calibrating the device sensors during aperiod of low activity may prevent the device from entering low powerstates or entirely turning off parts of the device to conserve power.

Aspects of the invention describe methods for opportunisticallycalibrating the sensors coupled to the computing device 2000 to conservepower. Generally, calibration of the computing device 2000 may betriggered when the device is in an activity state or during certainactivities that produce high quality calibration data. Additionally,calibration may be randomly and deterministically scheduled tocompensate for situations where the calibration has not been triggeredfor a set period of time.

Deterministic Scheduling Based on Triggers

Calibration of the sensors coupled to the computing device 2000 may beperformed or scheduled when the computing device 2000 or certaincomponents of the computing device 2000 are in an active state. For theactive state of the computing device 2000 the different components ofthe computing device 2000 may have different levels of power managementand activity states. Aspects of the invention may perform calibrationduring activity states that are associated with higher powerconsumption. When the computing device 2000 is already active andperforming other useful tasks, the power associated with collectingcalibration data is negligible compared to the other tasks. For example,the device may be in a high power mode when the display for the deviceis turned ON or when the Application processor is running. The displayis turned ON during such activities as emailing, texting, receiving orplacing a call, computing device 2000 ringing or vibrating,communicating using the computing device 2000 or browsing the web on thecomputing device 2000 and playing games and sensor measurements forgenerating calibration data may be collected by the processor duringsuch activity states.

In some aspects, calibration may be triggered by certain activities thatproduce high quality calibration data. Calibrating the computing devicesensors during these activities may be desirable to collect the highquality calibration data, even if the device is not operating in a highpower mode. High quality calibration data may include, but is notlimited to calibration data that may be used for offsetting the sensormeasurements with high confidence. For instance, for an accelerometer,high quality calibration data may include calibration data collectedwhile the device is stationary. Furthermore, the quality of the datawith respect to the calibration results may be improved by increasingthe number of orientations associated with collected calibration data.Making and receiving calls is an example of a possible trigger forcollecting calibration data that may provide valuable calibration data.In some devices, the Application processor may be turned off and asupplemental processor, micro-controller, DSP, or an ASIC may be usedfor conducting the call. Also, the display may also be turned off duringthe call to conserve power. Therefore, the device operates at a lowpower state with both the Application processor and the display isturned off. However, high quality calibration data with multipleorientations may be captured during a phone call. The number oforientation angles covered at each of the X, Y and Z axis may besignificantly improved when the calibration data is acquired whilemaking and receiving calls. In other aspects, calibration of the sensorson the computing device may also be deterministically scheduled with thepower consumption by the computing device 2000 is not a primary concern.For example, when the computing device 2000 battery is charging, powerconservation may not be a priority and calibration of the computingdevice 2000 may be deterministically scheduled.

FIG. 6 is a simplified flow diagram illustrating a non-limiting examplefor scheduling collection of calibration data. The process 600, such asthe scheduling module 405/605, described in FIG. 6, may be performed byprocessing logic that comprises hardware (circuitry, dedicated logic,etc.), software (such as is run on a general purpose computing system ora dedicated machine), firmware (embedded software), or any combinationthereof. In one embodiment, the process 600 is performed by one or morecomputing devices 2000 as described in FIG. 20. In one embodiment, thesensors 2050 acquire the sensor input for further processing byfiltering and processing components of the device described in FIG. 20.

At block 605, the scheduling module from the computing device 2000periodically performs checks for scheduling needs. At block 610, thescheduling module of the computing device 2000 checks if the device isin an activity state, charging or in a voice call. At block 620, if thescheduling module detects that the device is in an activity state,charging or in a call, the scheduling module may activate deterministicscheduling. At block 630, the calibration module is triggered forcollecting calibration data using the sensors coupled to the computingdevice 2000.

In one implementation, an activity mode may be determined by assessingthe power level associated with the state of the device. For instance,the device may be considered to be in an activity mode if the powerconsumption level associated with the device is above a threshold levelor the state of the device is one of a plurality of states associatedwith a power level above a pre-determined threshold level. Activitymodes may include but are not limited to emailing, texting, receiving orplacing a call, device ringing or vibrating, communicating using thedevice or browsing the internet on the device. Ringing and vibrating ofa computing device 2000, such as a mobile device may also act as atrigger to an activity state, such as receiving a phone call.

In some implementations, if the scheduling module executed by theprocessor 2010 of the computing device 2000 detects the computing device2000 in one of the orientations associated with high quality calibrationdata, the scheduling module schedules collection of calibration data fora period of time. For some sensors, such as accelerometers 2055, one ormore orientations may be associated with high quality calibration databased on determining that the computing device 2000 is stationary orsubstantially stationary at a particular orientation. In someimplementations, the transition of the device to a lower power state ora sleep state may be delayed at least until the completion of thecollection of calibration data. The delay in the transition of thedevice to a lower power state or a sleep state may be based onanticipating a transition of the computing device to a state associatedwith high quality data, and wherein the calibration data is collectedduring this state of high quality data. In one embodiment, the computingdevice 2000 may enter an intermediary state between the high power stateand the low power state for collecting calibration data.

Random Scheduling

The computing device 2000 may randomly schedule calibration of the oneor more sensors 2050 to compensate for situations where the calibrationhas not been triggered for a set amount of time. In such situations,aggressive scheduling may be needed to calibrate the sensors 2050associated with the computing device 2000, before the computing device2000 can solely rely on trigger based calibration of the computingdevice 2000. During random scheduling mode, the computing device 2000may collect calibration data regardless of the activity state or otherpower considerations for the computing device 2000. The calibrationalgorithm executed by the processor 2010 of the computing device 2000can further provide an option to switch to aggressive scheduling ifconvergence has not occurred based on the levels of entropy on eachaxis.

Referring back to FIG. 6, at block 615, the scheduling module maydetermine an insufficiency in the collected calibration data or a lackof convergence and in response to determining the insufficiency or thelack of convergence in the collected calibration data, activate randomscheduling for the collection of calibration data for the sensors. Inone embodiment, the lack of convergence in the collected calibrationdata may be determined based on the lack of scheduling of the secondtask for a fixed period of time. In one exemplary implementation, atblock 625, if the last calibration was performed more than 2 days agoand less than 30 days ago, random scheduling for calibration data may beactivated. In addition, at block 615, the scheduling module performed bythe processor 2010 may check if the calibration data is consideredreliable and if the sensors 2050 are at ambient temperature beforeactivating random scheduling. At block 630, the calibration module maybe triggered for collecting calibration data using the sensors 2050coupled to the computing device 2000

It should be appreciated that the specific steps illustrated in FIG. 6provide a particular method of switching between modes of operation,according to an embodiment of the present invention. Other sequences ofsteps may also be performed accordingly in alternative embodiments. Forexample, alternative embodiments of the present invention may performthe steps outlined above in a different order. To illustrate, a user maychoose to change from the third mode of operation to the first mode ofoperation, the fourth mode to the second mode, or any combination therebetween. Moreover, the individual steps illustrated in FIG. 6 mayinclude multiple sub-steps that may be performed in various sequences asappropriate to the individual step. Furthermore, additional steps may beadded or removed depending on the particular applications. One ofordinary skill in the art would recognize and appreciate manyvariations, modifications, and alternatives of the process.

Anticipation of Orientation Positions

In certain aspects of the invention, a timeout may be implemented aftercertain activities and before the device enters a low power state tocapture calibration data associated with anticipated orientations of thedevice. The timeout may further delay the computing device 2000 fromentering a low power state for the timeout period so that calibrationdata can be obtained. For instance, a user may place the computingdevice 2000 in various locations after emailing, texting or browsing theweb, such as shirt or pant pocket, table, handbag, etc., yielding highquality orientation data for calibrating the device sensors.

In some implementations, the scheduling device may anticipate atransition to a second state of the device based on the current state ofthe computing device 2000, wherein the second state is associated withhigh quality data, and wherein the calibration data is collected duringthe second state, and delay the transition of the computing device 2000to a lower power level for a first period of time in anticipation of atransition to the second state of the computing device 2000. If thetransition of the device to the second state is detected during thefirst period of time, the transition of the device to a lower powerstate may be delayed for a second period of time, and the collection ofcalibration data may be scheduled for the second period of time.

FIG. 7 is a timing diagram illustrating an exemplary implementation forextending a window for collecting calibration data in anticipation oforientations of the computing device 2000 associated with high qualitycalibration data. At time 705, the completion of the activity associatedwith high quality calibration data, higher power, or a power savingagnostic state such as charging the battery of the computing device 2000may be detected. In one embodiment, the computing device 2000 mayproduce a DEF_SCH_OFF trigger, at time 705, in response to detecting thecompletion of the activity state. The computing device 2000 alsocontinues to monitor the state of the computing device 2000 for a firstperiod of time (T1 in FIG. 7), ending at time 710, in anticipation ofdetecting relatively stationary positions or orientations of interestfor collecting calibration data for the computing device 2000. Thesestationary positions and orientations of the computing device 2000 maybe associated with durations of availability of high quality calibrationdata. If an orientation of interest is detected during the first periodof time (T1), the scheduling module may signal a request (REQ_EXTN attime 715) for an extension of time for a second period of time (T2 inFIG. 7), ending at time 720, for collecting high quality calibrationdata. In FIG. 7, the collection of the calibration data may be halted attime 720 that also marks the end of the second time period.Alternatively, at time 725, the scheduling module, executed by theprocessor 2010, may stop collecting calibration data when by asserting aSTOP_EXTN signal.

II. Calibration Module

In the discussion that follows, as well as in other portions of thedisclosure, such as the accompanying figures, the terminology defined inthe following table may be used:

Term Definition CL_OFF Closed loop offset, stores the offset parameter(iteratively updated) CL_SF Closed loop scale factor, stores the scalefactor parameter (iteratively updated) OFF_CORR Offset correctionscomputed from KF after loop closure SF_CORR Scale factor correctionscomputed from KF after loop closure QMD QMD = 1 means motion state, 0means stationary CALC_ENT Function invoked to computed orientationentropy LSB LSB size of the sensor TEMP Current temperature TEMP_AMBAmbient temperature K Sensor offset temperature coefficient CL_FLAGClosed loop active flag P Covariance matrix of the KF RES KF residualsENT Orientation entropy values COV RATIOS Ratio of variance tocovariance terms TBIN Temperature bin

FIG. 8 is a simplified flow diagram illustrating a non-limiting methodperformed by embodiments of the invention for scheduling an execution ofa task on a computing device 2000. The process 800, such as thecalibration module, may be performed by processing logic that compriseshardware (circuitry, dedicated logic, etc.), software (such as is run ona general purpose computing system or a dedicated machine), firmware(embedded software), or any combination thereof. In one embodiment, theprocess 800 is performed by one or more computing devices 2000 asdescribed in FIG. 20.

Referring to exemplary FIG. 8, at block 802, components of the computingdevice 2000 performing embodiments of the invention may detect a firststate of the computing device 2000, wherein the first state of thecomputing device 2000 may be associated with a first power level and afirst task. At block 804, embodiments of the invention may determinethat the first power level associated with the first state is above athreshold or that a battery coupled to the device is charging. At block806, embodiments of the invention may schedule an execution of a secondtask on the computing device 2000, in response to determining that thefirst power level associated with the first state is above the thresholdor that the battery coupled to the device is charging. The second taskon the device may be a non-real time task, non-latency sensitive task ora background task.

In one embodiment, determining of the first power level associated withthe first state is based on the power consumption while executing thefirst task. In another embodiment, determining that the first powerlevel associated with the first state is above the threshold comprisesdetermining that the first state is one of a plurality of statesassociated with a power level above the threshold. The plurality ofstates associated with the power level above the threshold may comprisehaving one or more of the display of the device turned on, theapplication processor performing activity, emailing texting, receivingor placing a call, device ringing or vibrating, communicating using thedevice or browsing the internet on the device. In yet anotherembodiment, determining of the first power level associated with thefirst state is based on accessing the power state of the computingdevice 2000 by accessing hardware mechanisms on the computing device2000.

In one embodiment, the second task may be associated with automaticallycollecting of calibration data using a sensor 2050. The sensormeasurements from the sensor may be captured without prompting a user toplace the computing device 2000 in a calibration position or prompting auser to execute a calibration routine. The sensor 2050 may be one of anaccelerometer 2055, a gyroscope 2060, or a magnetometer 2065.Automatically collecting calibration data by the processor 2010 maycomprise monitoring the computing device 2000 for an orientationassociated with high quality calibration data at a plurality oforientations for a first period of time, and in response to detectingthe device is in one of the orientations associated with high qualitycalibration data, collecting calibration data for a second period oftime. In one implementation collecting calibration data at theorientation associated with high quality data may further comprisedetermining that the computing device 2000 is stationary orsubstantially stationary at the orientation. In one aspect, the sensormeasurements may be collected while the device is at the first powerlevel for determining if the computing device 2000 has transitioned toan orientation associated with high quality calibration data forcollecting calibration data using the sensor 2050 for a second period oftime.

In one embodiment, the second task is scheduled and executing in thebackground while the primary/first task is completed. The method mayfurther comprise delaying the transition of the device to a second powerlevel at least until the completion of the second task, wherein thefirst power level is higher than the second power level. In oneimplementation, delaying the transition of the device to a second powerlevel comprises anticipating a transition to a second state of thedevice, based on the first state of the device or a trigger such asringing of a phone, wherein the second state is associated with highquality data, and wherein the calibration data is collected during thesecond state.

In another embodiment, the second task of collecting data may beperformed after the completion of the first task, such as a phone call,when the computing device 2000 may probabilistically go to a stationaryposition. Herein, automatically collecting of calibration data using thesensor 2050 may include anticipating a transition to a second state ofthe device based on the first state of the device, wherein the secondstate is associated with high quality data, and wherein the calibrationdata is collected during the second state, and delaying the transitionof the device to a second power level for a first period of time inanticipation of a transition to a second state of the device. The methodmay further comprise detecting a transition of the device to the secondstate within the first period of time, delaying the transition of thedevice to a second power level for a second period of time, in responseto detecting a transition of the device to the second state within thefirst period of time; and scheduling the automatic collection ofcalibration data during the second period of time. The high qualitycalibration data may be collected during making or receiving phonecalls.

In one embodiment, in response to determining insufficiency or lack ofconvergence in the collected calibration data, activate randomscheduling of the second task on the device. The insufficiency or lackof convergence in the collected calibration data may be determined basedon the lack of scheduling of the second task for a first period of time.

It should be appreciated that the specific steps illustrated in FIG. 8provide a particular method of switching between modes of operation,according to an embodiment of the present invention. Other sequences ofsteps may also be performed accordingly in alternative embodiments. Forexample, alternative embodiments of the present invention may performthe steps outlined above in a different order. To illustrate, a user maychoose to change from the third mode of operation to the first mode ofoperation, the fourth mode to the second mode, or any combination therebetween. Moreover, the individual steps illustrated in FIG. 8 mayinclude multiple sub-steps that may be performed in various sequences asappropriate to the individual step. Furthermore, additional steps may beadded or removed depending on the particular applications. One ofordinary skill in the art would recognize and appreciate manyvariations, modifications, and alternatives of the process.

FIG. 9 illustrates an example components of a calibration moduleaccording to one or more illustrative aspects of the disclosure. In thepassages that follow, functional blocks included in the diagramillustrated in FIG. 9 will be described in further detail. In thediscussion that follows, as well as in other portions of the disclosure,such as the accompanying figures, embodiments of the invention may bedescribed using an accelerometer 2055 as an exemplary sensor, however,other sensors such as gyroscopes 2060, magnetometers 2065, barometers,etc. may be used for implementing aspects of the invention instead. Thevarious modules described in FIG. 9 may be implemented using hardware,software or firmware or any combination thereof.

At the outset of the example calibration module illustrated in FIG. 9,the incoming sensor 2050 samples may be tested for high quality datasamples, at block 902. For an accelerometer 2055, the sensor samples maybe tested for stationarity. Stationarity can be determined based on acombination of Qualcomm Motion Detector (QMD) and Gradient MotionDetector (GMD) and can be implemented within the calibration algorithm.Once the sample is determined to be stationary, it can be averaged withother samples that are part of the same stationary segment. The varianceof the stationary segment data can also computed. For other sensors,such as gyroscopes 2060, other motions and orientations besides thestationarity of the device may be associated with high quality data.

Continuing to refer to FIG. 9, at block 904, the data pre-processingblock pre-processes the sensor 2050 input before passing the data overto the Kalman Filter. For the exemplary embodiment including theaccelerometer 2055, the pre-processing block 904 computes the scalaracceleration from the averaged accelerometer readings. The scalaracceleration variance is also computed as a function of the individualaxes variances. These two features are passed to the Kalman Filter asthe measurement and the noise estimates. The details on the featurecreation and its variance estimation are described in greater detailbelow.

At block 906, the Kalman Filter may use inputs from the pre-processingblock 904 to compute an estimate of the calibration parameters optimally(minimizing the mean squared error). At a high level, the Kalman Filteruses each new measurement weighted by its variance, thus automaticallyassigning smaller weights to measurements that are unreliable. The lowvariance or reliable measurements contribute more to the estimate andare incorporated into the last estimate appropriately. The Kalman Filterprovides the calibration parameters and their error estimates. Thisblock is discussed further below.

At block 908, the feedback block monitors the variance of the estimatedcalibration parameters. When the variances meet certain limits, theestimated parameters are deemed reliable for feedback. In other words,the estimated parameters are accurate enough to be applied to theincoming acceleration samples in real-time. Due to assumptions oflinearity in the Kalman Filter model, the performance of the filterdeteriorates when the offsets or scale factors are large. In order tomitigate these effects, the estimated parameters may be applied to theincoming samples. As the corrections are applied, the offsets remainingto be estimated become smaller; hence the effects of non-linearity aremitigated. Therefore, the accuracy and convergence may be improved byusing feedback.

At block 910, the decision block may use data from the Kalman Filterblock 906, the feedback monitor block 908 and independent metrics 912and determine the quality and reliability of the estimated parameters.When the metrics indicate convergence accuracy at par with therequirements, the results of the calibration algorithm may be publishedto the client. Some metrics used are estimated parameter variance,residual from the Kalman Filter and orientation entropy. The metrics arediscussed in more detail in FIG. 10, FIG. 11 and FIG. 12.

The Kalman Filter estimates a process by using a feedback control. Theprocess state (offsets and scale factors) is estimated at some time, andthen compared to the new noisy measurements. The remaining error is thenfeedback, and the process is repeated. One exemplary embodiment of theinvention is described step-by-step here:

Step 1. As the stationary accelerometer measurements (computed over anentire stationary period or segment) and their variances are directed tothe Kalman Filter, the time update phase projects the current offset andscale factor estimates (‘State’) and the variance. In this case, thecurrent state is equivalent to the previous state (a priori) and thecurrent covariance is equal to the last covariance matrix (a prioricovariance).

Step 2. Next, the measurement update phase begins by first computing theKalman gain. Next, the current measurement z is incorporated to generatethe a posteriori estimate of the calibration parameters. At this time,the a posteriori variance is also updated.

Step 3. After each time and measurement update pair, the process isrepeated with the previous a posteriori estimate used to predict a new apriori estimate. This recursive procedure is done until the desiredaccuracy is obtained.

Although specifics of accelerometer 2055 may be used in describing theembodiments of the invention, as discussed with respect to FIG. 8 above,any other sensors, such as magnetometers 2065, gyroscopes 2060,barometers, etc. may be used in embodiments of the invention.

FIG. 10 illustrates an example method of updating calibration parametersusing a feedback loop according to one or more illustrative aspects ofthe disclosure. Aspects of FIG. 10 discuss the decision monitor 910 fromFIG. 9. The process 1000 is performed by processing logic that compriseshardware (circuitry, dedicated logic, etc.), software (such as is run ona general purpose computing system or a dedicated machine), firmware(embedded software), or any combination thereof. In one embodiment, theprocess 1000 is performed by one or more computer systems 2000 asdescribed in FIG. 20. In one embodiment, the sensors 2050 acquire thesensor input for further processing by filtering and processing bycomponents of the computing device 2000 described in FIG. 20.

As previously discussed, by using a feedback loop, such as the onedescribed in this example method, measurement data may be applied tosensor readings in real-time (e.g., during an on-going automatedcalibration process) so as to incrementally improve performance. Forexample, if a device is to be calibrated over a three-day period,measurements captured on the first day may be used to apply calibrationparameters to the accelerometer data on the second day, even though thefull three-day calibration period has not yet concluded. In thisexample, by incrementally calibrating the sensor data, measurements onthe second day will be more accurate, and, in turn, measurements on thethird day will be more accurate as well.

At block 1001, factory/default calibration settings may be loaded. Forexample, in block 1001, computing device 2000 may load defaultcalibration parameters (e.g., loaded on computing device 2000 at thetime of manufacture in the factory, for instance).

At block 1002, sensor input corresponding to a calibration sensormeasurement may be received. For example, at block 1002, computingdevice 2000 may receive such sensor input from one or more sensors, suchas accelerometers 2055, included in computing device 2000. At block1003, calibration parameters may be updated. For example, at block 1003,computing device 2000 may update one or more calibration parametersbased on the received sensor input.

At block 1004, it may be determined whether a limit has been reached.For example, at block 1004, computing device 2000 may determine whethera sufficient number of position measurements have been taken to warrantfinalization and/or publication of the one or more calibrationparameters. In at least one arrangement, this determination may be basedon a predetermined threshold. In other arrangements, this determinationmay be based on other factors, such as the diversity of the orientationsobtained or other factors described discussed in FIG. 11 and FIG. 12. Ifit is determined at block 1004 that the limit has not been reached, thenthe method may return to block 1002 where additional sensor input may bereceived. In this way, a feedback loop, such as a feedback loop and/orclosed loop may be formed. On the other hand, if it is determined, inblock 1004, that the limit has been reached, then at block 1005, thefinal calibration may be published. For example, at block 1005,computing device 2000 may finalize, publish, and/or store thecalibration parameters generated and/or tuned through various iterationsof the feedback loop.

It should be appreciated that the specific steps illustrated in FIG. 10provide a particular method of switching between modes of operation,according to an embodiment of the present invention. Other sequences ofsteps may also be performed accordingly in alternative embodiments. Forexample, alternative embodiments of the present invention may performthe steps outlined above in a different order. To illustrate, a user maychoose to change from the third mode of operation to the first mode ofoperation, the fourth mode to the second mode, or any combination therebetween. Moreover, the individual steps illustrated in FIG. 10 mayinclude multiple sub-steps that may be performed in various sequences asappropriate to the individual step. Furthermore, additional steps may beadded or removed depending on the particular applications. One ofordinary skill in the art would recognize and appreciate manyvariations, modifications, and alternatives of the process.

The Decision Monitor module 910 monitors the quality of the estimatedstate, and allows for publishing the calibration results when requiredreliability is achieved. The Decision Monitor uses a combination of thefollowing metrics to make the decision:

-   -   Estimated variance (diagonal elements of Parameter Variance (P)        matrix)    -   Orientation entropy    -   KF Residuals    -   KF Scalar length residuals    -   Estimated covariance ratios    -   Magnitude of CL offsets used to modify thresholds        Each of the metrics is described in detail below:        Estimated Variance

Embodiments of the invention determine the diagonal elements of the aposteriori covariance matrix. If the elements are below a tightthreshold (small variance) then the estimated states may be consideredreliable. The covariance matrix may not represent the actual errors inthe state estimate. In the current model, the P matrix may beover-optimistic. Though it may be useful to have several measurements,not every measurement may contribute to improving the state estimation.The diversity in motion may help in convergence, however the model maynot account for this aspect explicitly. Thus, P elements may decreaseeven if the phone position is very similar to the previous positions. Asan example, if the computing device 2000 is in the same orientation allthe time, the terms in P will decrease (at a very slow rate). But, overa long period of time, the results might have a small variance, but inreality the state may have been estimated by using only one uniqueposition.

The Kalman Filter does not know if the estimate is derived from uniquepositions or not since the model lacks this information. For instance,if there are 3 unique positions, and 6 unknowns (3 offsets, 3 scalefactors) to be estimated, the Kalman Filter may not have the knowledgebuilt-in to avoid such scenarios. Thus, this information may be codedexternally in the form of orientation entropy and monitored using KalmanFilter as described in further detail below. Thus, using the errorcovariance terms as a metric to check convergence may be a desired, butmay not a sufficient condition to declare ‘calibration completed.’

Orientation Entropy

A calibration system for a plurality of sensors coupled to a devicemonitors the sensor input over time to calibrate the sensors. However,if a mobile device is in the same orientation over a long period oftime, the results might have a small variance, falsely indicating goodcalibration results. In reality the state was estimated by using onlyone or very few unique orientations resulting in poor calibrationparameters for the various sensors in the system.

A Kalman Filter used in such systems for filtering sensor measurementsdoes not know if an estimate is derived from unique orientations or notsince the model lacks this information. Thus, aspects of the inventionencode this information externally in the form of orientation entropy(FIG. 11) and frequency binning (FIG. 12) and monitor the results fromKalman Filter.

One of the assumptions made in the algorithm may be that themeasurements are independent and ideally obtained from independent phonepositions. To this effect, there is no check done within the KalmanFilter to include the orientations covered as a part of themeasurements. Thus, we do a check for the orientations covered (on a peraxis basis) outside of the filter. The orientation angle may bedetermined as the inverse cosine of the ratio of the vector accelerationto the scalar acceleration as shown in:

$\theta_{x} = {\cos^{- 1}\left( \frac{a_{x}}{{acc}_{scalar}} \right)}$

Embodiments of the invention maintain a histogram for each axis, andwith fixed bins and covering the angles from 0 to 180 degrees. Whenevera new measurement may be received, the orientation histogram may beupdated and corresponding probability of the orientation is updated.This may be done as shown in:

$p_{\theta_{x}} = \frac{f_{\theta_{x}}}{\sum\limits_{1}^{nbins}f_{\theta_{x}}}$

Following this, the entropy of the orientation may be computed as shownin:

-   -   Error! Reference source not found.

Either the histogram counts or entropy could indicate the differentorientations covered. By making sure that either one or both quantitiesare above a threshold, it may be determined if enough independentmeasurements have been used. Thus, this independent information willaugment decision about the reliability of the estimated calibrationparameters.

${acc}_{scalar} = \sqrt{a_{x}^{2} + a_{y}^{2} + a_{z}^{2}}$$\theta_{x} = {\cos^{- 1}\left( \frac{a_{x}}{{acc}_{scalar}} \right)}$f_(θ_(x)) = ⌊f₀f₁f₂  …  f_(nbins)⌋$p_{\theta_{x}} = \frac{f_{\theta_{x}}}{\sum\limits_{1}^{nbins}f_{\theta_{x}}}$$e_{x} = {- {\sum\limits_{1}^{nbins}{p_{\theta_{x}}{\ln\left( p_{\theta_{x}} \right)}}}}$

Thus, before making a decision on publishing the results, the decisionmonitor ensures that enough diverse orientations have occurred. Both themaximum orientation entropy and the current entropy are used to make thedecision. The decision is made by using a lower limit on the entropy.

Orientation Entropy Used in Different Blocks:

Loop Closure Condition:

Orientation Entropy may be used as an additional criteria before loopclosure (feedback). This is done to ensure that feedback is not startedwhen very similar phone orientations occur. In some tests, we observedthat feedback based on variance terms alone caused incorrect feedback.Including additional entropy criteria even for the first time the loopcloses helps in filter stability

Partial Rest of P Matrix:

The Entropy number may characterize the diversity in the data. Entropymay be used to modify P when loop closure is done—additional term isadded to reset the P to a large value for the very first time of loopclosure:

${P_{k}\left( {1,1} \right)} = {{P_{k}\left( {1,1} \right)}*\left( {1 + \frac{1}{e_{k,x}}} \right)}$${P_{k}\left( {2,2} \right)} = {{P_{k}\left( {2,2} \right)}*\left( {1 + \frac{1}{e_{k,y}}} \right)}$${P_{k}\left( {3,3} \right)} = {{P_{k}\left( {3,3} \right)}*\left( {1 + \frac{1}{e_{k,z}}} \right)}$

The increase in P may avoid the transients due to loop feedback orclosure. At closure, the non-linearity errors are reduced considerably,and the model becomes more accurate.

Freezing P During Similar Positions:

Orientation Entropy may be used to provide information on whether aposition has changed or not, and avoid the decrease in P when the phoneposition does not change from the previous position:P _(k) =αP _(k-1)+(1−α)P _(k),where α is 1 or 0 respectively, depending on whether the currentorientation is equal to the previous orientation or not.

FIG. 11 illustrates a non-limiting example method of evaluatingcalibration measurements using orientation entropy according to one ormore illustrative aspects of the disclosure. The process 1100 isperformed by processing logic that comprises hardware (circuitry,dedicated logic, etc.), software (such as is run on a general purposecomputing system or a dedicated machine), firmware (embedded software),or any combination thereof. In one embodiment, the process 1100 isperformed by one or more computer systems 2000 as described in FIG. 20.In one embodiment, the sensors 2050 acquire the sensor input for furtherprocessing by filtering and processing by components of the devicedescribed in FIG. 20. In one embodiment a Kalman Filter is may be used.

At block 1101, a plurality of sensor calibration measurements, such asaccelerometer measurements, and corresponding position/orientationinformation may be received (e.g., by computing device 2000 and/or oneor more processors 2010 included therein from one or more accelerometersand/or other sensors included at computing device 2000). Forillustration purposes, accelerometers are discussed, however, othersensors may be used in embodiments of the invention. At block 1102, theone or more processors 2010 may determine whether the received sensorcalibration measurements associated with the position/orientation hasbeen previously analyzed.

If the sensor calibration measurements associated with theposition/orientation has not been previously analyzed, then at block1103, one or more sensor calibration measurement values and one or moreconfidence values of one or more calibration parameters may be updated.On the other hand, if the position has been previously analyzed, then atblock 1104, one or more sensor calibration measurement values of one ormore calibration parameters may be updated without updating one or moreconfidence values of the one or more calibration parameters.

Subsequently, at block 1105, prior to publishing final calibrationparameters, the one or more processors 2010 may calculate theorientation entropy, to determine a degree to which the plurality ofcalibration measurements were obtained at different orientations. Atblock 1106, the one or more processors 2010 may determine whether thecalculated orientation entropy exceeds a threshold. If the one or moreprocessors 2010 determine that the orientation entropy does not exceed athreshold, then at block 1107, the device may continue measuring andanalyzing data to calibrate one or more sensors. In one embodiment, inresponse to determining that the orientation entropy is below apredetermined threshold, the processor 2010 may discard a sensorcalibration measurement for an orientation for which a sensorcalibration measurement has been previously received without updatingthe one or more calibration parameters. In another embodiment, thesensor calibration measurement for an orientation may be used, by theprocessor 2010, for reducing noise in the sensor calibrationmeasurements without updating the one or more calibration parameters. Onthe other hand, if it is determined that the orientation entropy doesexceed the threshold, then at block 1108, the final calibrationparameters may be published by the one or more processors 2010.

It should be appreciated that the specific steps illustrated in FIG. 11provide a particular method of switching between modes of operation,according to an embodiment of the present invention. Other sequences ofsteps may also be performed accordingly in alternative embodiments. Forexample, alternative embodiments of the present invention may performthe steps outlined above in a different order. To illustrate, a user maychoose to change from the third mode of operation to the first mode ofoperation, the fourth mode to the second mode, or any combination therebetween. Moreover, the individual steps illustrated in FIG. 11 mayinclude multiple sub-steps that may be performed in various sequences asappropriate to the individual step. Furthermore, additional steps may beadded or removed depending on the particular applications. One ofordinary skill in the art would recognize and appreciate manyvariations, modifications, and alternatives of the process.

FIG. 12 illustrates a non-limiting example method of evaluating sensorcalibration measurements using frequency binning according to one ormore illustrative aspects of the disclosure. The process 1200 isperformed by processing logic that comprises hardware (circuitry,dedicated logic, etc.), software (such as is run on a general purposecomputing system or a dedicated machine), firmware (embedded software),or any combination thereof. In one embodiment, the process 1100 isperformed by one or more computer systems 2000 as described in FIG. 20.In one embodiment, the sensors 2050 acquire the sensor input for furtherprocessing by filtering and processing by components of the devicedescribed in FIG. 20. In some embodiments a Kalman Filter may be used.

At block 1201, a plurality of sensor calibration measurements, such asacceleration measurement information and corresponding positioninformation may be received (e.g., by computing device 2000 and/or oneor more processors included therein from one or more accelerometersand/or other sensors included in computing device 2000). Forillustration purposes, accelerometers are discussed, however, othersensors may be used in embodiments of the invention. At block 1202, itmay be determined whether the position has been previously analyzed.

If the position has not been previously analyzed, then at block 1203,one or more measurement values and one or more confidence values of oneor more calibration parameters may be updated. On the other hand, if theposition has been previously analyzed, then at block 1204, one or moremeasurement values of one or more calibration parameters may be updatedwithout updating one or more confidence values of the one or morecalibration parameters.

Subsequently, at block 1205, the count of a frequency bin correspondingto the position may be increased. For example, bins may be assigned to0° to 360° in five degree increments, such that any position fallingwithin a particular increment increases the count for that increment's“bin.” In this way, the variety of positions being analyzed can betracked, as described above.

At block 1206, the processor may determine whether a sufficient numberof positions have been analyzed. If it is determined that a sufficientnumber of positions have not been analyzed, then at block 1207, thedevice may continue measuring and analyzing data to calibrate one ormore sensors. In one embodiment, in response to determining that asufficient number of positions have not been analyzed, the processor2010 may discard a calibration measurement for an orientation for whicha calibration measurement has been previously received without updatingthe one or more calibration parameters. In another embodiment, thecalibration measurement for an orientation may be used, by the processor2010, for reducing noise associated with the calibration measurementswithout updating the one or more calibration parameters. On the otherhand, if it is determined that a sufficient number of positions has beenanalyzed, then at block 1208, the final calibration parameters may bepublished (e.g., as described above).

It should be appreciated that the specific steps illustrated in FIG. 12provide a particular method of switching between modes of operation,according to an embodiment of the present invention. Other sequences ofsteps may also be performed accordingly in alternative embodiments. Forexample, alternative embodiments of the present invention may performthe steps outlined above in a different order. To illustrate, a user maychoose to change from the third mode of operation to the first mode ofoperation, the fourth mode to the second mode, or any combination therebetween. Moreover, the individual steps illustrated in FIG. 12 mayinclude multiple sub-steps that may be performed in various sequences asappropriate to the individual step. Furthermore, additional steps may beadded or removed depending on the particular applications. One ofordinary skill in the art would recognize and appreciate manyvariations, modifications, and alternatives of the process.

Residuals

The residual or measurement innovation of the Kalman Filter has alsobeen described above. Large residuals indicate the need for correctionto the predicted measurements (based on past measurements). Thus, asmore and more measurements are processed, the expectation is that theresiduals will become smaller. If the residuals are small it generallyreflects a good estimate. We inspect the innovations vector for largeentries and use it as an indication that the results are not reliableyet.

The Kalman Filter assumes white noise in the measurements. The currentmeasurement noise may be correlated. In addition, non-linearity in themodel could to non-zero residuals. But, as the calibration progresses,and the estimated offsets become more accurate, the residuals becomesmaller. Ideally, the mean of the residuals should be equal to zero.

This Kalman Filter model may be non-optimal, and may not provideresiduals with zero mean due to some or all of the following factors:(1) Non-linearity; (2) Unmodelled variables/states; (3) Correlatednoise; and (4) Ignoring the diversity in positions. In oneimplementation, the residual threshold may be 50 mg², and the standarddeviation may be 30 mg². Embodiments of the invention may set a bound insome instances on the standard deviation in order to increase therobustness of the estimate and ensure that the filter reaches a steadystate error.

Scalar Length Residuals

Both the residual and scalar should be equivalent. In oneimplementation, where the residual is deduced in mg² the scalar lengthmay be calculated to compare the scalar acceleration lengths (mg) andthe residual as follows:residual_scalar=√{square root over (Z _(k) +G ²)}−√{square root over (H_(k) X _(k) +G ²)}Estimated Covariance Ratios

The ratio of the variance to the covariance terms is also used to checkfor possible state coupling. The covariance matrix is shown in equationbelow. In one embodiment, the ratio of the state variance term to thecovariance term (4 ratios/state) may be used and may not publish theresults until the ratio is greater than 1. This may imply that thecovariance terms are smaller than the state variance. This metric mayprovide an indication of the quality of convergence of each of thestates with respect to the other states.

$P_{k} = \begin{bmatrix}v_{xoff} & c_{xyoff} & c_{xzoff} & c_{xoffsf} & c_{xoffysf} & c_{xoffzsf} \\c_{xyoff} & v_{yoff} & c_{yzoff} & c_{yoffxsf} & c_{yoffsf} & c_{yoffzsf} \\c_{xzoff} & c_{yzoff} & v_{zoff} & c_{zoffxsf} & c_{zoffysf} & c_{zoffsf} \\c_{xoffsf} & c_{yoffsf} & c_{zoffxsf} & v_{xsf} & c_{xysf} & c_{xzsf} \\c_{xoffysf} & c_{yoffsf} & c_{zoffysf} & c_{xysf} & v_{ysf} & c_{yzsf} \\c_{xoffzsf} & c_{yoffzsf} & c_{zoffsf} & c_{xzsf} & c_{yzsf} & v_{zsf}\end{bmatrix}$

For example, in one embodiment, for x-axis offsets following conditionsmay be checked:

$\frac{v_{xoff}}{c_{xyoff}} > {1\mspace{14mu}{AND}\mspace{14mu}\frac{v_{xoff}}{c_{xzoff}}} > {1\mspace{14mu}{AND}\mspace{14mu}\frac{v_{xsf}}{c_{xysf}}} > {1\mspace{14mu}{AND}\mspace{14mu}\frac{v_{xsf}}{c_{xzsf}}} > 1$Closed Loop Offset Magnitudes

If the observed closed loop offsets are large, it may indicate a largeinitial offset or scale factor in the data. Thus, obtaining large closedloop results could be used to gauge the impact of non-linearity. Also,according to experiments, nearly half of the error may be corrected byperforming loop closure during feedback. Thus, the magnitude of theclosed loop estimate may be used to set the threshold windows forcomputing the residual mean and standard deviations. For final decision,the threshold on each metric may need to be satisfied.

3D Histogram Accelerometer Binning

In one embodiment, the incoming sensor calibration measurements from thesensors may be saved in a 3D histogram and input to the Kalman Filterperiodically to avoid the decrease in covariance matrix due torepetitive similar positions. This may be an extension of the proceduresdescribed above in respect to FIG. 10 and FIG. 11. Every measurement inthe orientation bin may be averaged with measurements in the same bin.Thus, each orientation bin may be used as an input to the Kalman Filteronly once. This may be advantageous in avoiding under-estimation of P.

Algorithm Design Considerations

Feedback to Avoid Non-Linearity

In an exemplary simplified model, the estimated offsets and the scalefactors may be assumed to be linearly related to the measurements.However, in reality, the relationship is non-linear and using such asimplified model has its implications in the form of performance.Specifically, if the estimated offsets and scale factors are large (100mg or 5% and over), the estimate errors could be significant.

In order to reduce errors due to non-linearity, the intermediateestimates may be applied to the incoming raw accelerometer data. Byapplying the intermediate results and ‘closing the loop’ the newestimates may be smaller (since the data is partially corrected). Thisfeedback loop may be designed on the basis of the estimated parameterstandard deviations. It is desirable that the estimated parametersstandard deviations are accurate and reliable in order to avoidinstability in feedback. Other considerations when closing the loop maybe to avoid transients in the residuals, and re-initialize the statevector to zeros and possibly the variances to a higher value. Accordingto experimental data, no feedback may increase the errors in offset to50 mg or more. And applying feedback resulted in the error in all theaxes reducing below 20 mg. Thus, closing the loop correctly can resultin improved performance.

Normalizing the H Matrix

By normalizing the H matrix with magnitude of gravity, the scale factornon-linearity may be reduced. This is because the slope is nownormalized, and the effects of large offsets are reduced. Theobservation matrix may be modeled as shown:H _(k)(1:3)=G*H _(k)(1:3)/√{square root over (H _(k)(1)² +H _(k)(2)² +H_(k)(3)²)}  19H _(k)(4:6)=G ² *H _(k)(1:3)/√{square root over (H _(k)(1)² +H _(k)(2)²+H _(k)(3)²)}  20Lower Bound on Measurement Variance (“R”)

The measurement variance may be computed as a function of the varianceson individual axes. In addition, the variance computation reliabilitydepends on the length of the stationary period. For short segments, theestimated variance may not be reliably calculated. For long segments, itis possible that the variance is reduced to a very small value, andhence underestimated. To avoid these scenarios, a lower bound may beused on both the individual axes variance as well as the averagevariance over the length of the stationary segment. These bounds may bedesigned based on sensor noise, quantization and resolution errors.

Lower Bound on Estimated Parameter Variance (“P Matrix”)

In general, greater number of stationary segments processed by theKalman Filter tend to yield better state estimates. Thus, the variancebecomes small after several stationary segments are processed. In orderto avoid the values from becoming very small or close to zero, a lowerbound on the variance may be created by embodiments of the invention. Insome instances, this may be necessary since neither the measurements northe estimated parameters may be assumed to be perfectly modeled orcomputed. In addition, when the variances of the predicted values aresmall, the new measurements may be incorporated with smaller weights.This may be detrimental since new measurements could potentially allowfor any slow changes or transitions in the offset and scale factorerrors.

The variance may have natural limits based on factors like noise floor,quantization and resolution errors in the sensors etc. Since the modeldoes not explicitly account for these errors, an artificial lower boundon the variance may be used. In addition, when the results are ready tobe published to the external client, embodiments of the inventions mayavoid providing unrealistic or over optimistic variances by scaling thevalues if needed.

Proper Initialization of the State Vector and their Variances

In some implementations, the initial estimates provided to the KalmanFilter may be chosen as accurately as possible and the initial offsetand scale factor may be assumed to be zero. The error variances foroffsets may be initialized to (30 mg)^2, and (3%)^2 for scale factors.In some implementations, the initializations may also incorporateinformation from sensor specifications to further improve results.

Storing “Good” Measurements for Verification

Some fixed numbers of good measurements that may be determined fromdifferent orientations may be stored in the registry for later use. Thisset of saved measurements may be used to reduce non-linearity as well asadd robustness to the algorithm. The measurements may be stored incircular buffers, and the window size may be determined based on thememory 635 availability in the registry. The decision on whether ameasurement should be stored or not may be based on the followingcriteria:

Orientation Frequency Bins

The orientation frequency bins are maintained on a per axis basis. Thebin width may be set to 30 degrees and a range of 0 to 180 degrees iscovered. The frequency vector is updated each time a new measurement isreceived. In one implementation, a fixed number of positions may beaccumulated in each bin in order to have diverse measurements for eachaxis. Some implementation may be in the form of a moving window of size10.

Vertical or Horizontal Acceleration Positions

When the axes are aligned to horizontal or vertical (aligned to gravityor away from gravity), the measurements may be saved for future use, inmemory 635 or any other storage area. This may ensure that positionshelpful in converging the calibration data are stored. Also,measurements are automatically stored if the user performs the6-position manual calibration tests. Ideally the buffered data should beprocessed whenever there is an opportunity to do so without affectingthe power consumed, and hence expedite convergence during 6-positiontests.

High Change in Orientation Entropy

If the orientation entropy gradient (current entropy—previous entropy)for any axis is greater than the maximum orientation entropy encounteredso far, the measurement may be stored in the registry. The measurementsmay be stored when any of the above conditions (i.e. if the orientationis unique, or if any axis is aligned to gravity or it has high entropycompared to history) are met, and without repetitions. The storage maybe performed separately for each temperature range. The calibrationalgorithm should process the stored measurements whenever there isminimum effect on power consumption. For e.g. during charging, or whenphone is in high power mode.

Behavior During Continuous Stationarity

During long periods of stationary data or near stationary data, themeasurements are redundant and do not help much in the state estimateconvergence. But, the covariance matrix reflects otherwise. This issueof over-optimistic covariance estimates has been discussed above. Thealgorithm behavior during three possible cases is described below:

Long Stationary Periods (Charging)

The accelerometer data averaging may begin when stationarity is detectedand the averaging may continue until either the i) end of stationarityor the ii) maximum limit on the number of samples averaged is reached.Averaging of data may start back up on detection of motion or change intemperature. In other words, the measurement may be regarded as a newupdate and may be used for the appropriate temperature bin.

Non-Observable Axis

In situations where there is periodic motion continuously about one axis(making the axis errors not observable), and there may be continuousmotion about the other 2 axes, the stationary detection may not capturethe motion involved. This could result in a decrease in the estimatedcovariance matrix which may lead to an overly optimistic P. It may bedetected that one axis is continuously falling in the same bin bymonitoring the frequency bins. If this happens on either of the axes,the measurement may be used in the state estimate, but the P matrix maynot be decreased. Thus, the benefit of having redundant positions may beincorporated in the state estimate (noise reduction), but the P may beprevented from reflecting this.

P Reset During First Loop Closure

Feedback may be applied to mitigate the effects of non-linearity in themodel. When the estimated parameters are applied to the incomingaccelerometer data, the non-linearity may be reduced considerablyleading to a more accurate model. Thus, until loop closure, the stateestimate may be used to help in model error reduction. The covarianceterms may already be low (due to the already processed measurements toattain closure), and may need to be reset to high values to reflect anew start of the calibration process. The P may be reset to theinitialization value or reset based on orientation entropy achieveduntil closure for the first time. If P is reset to a very large initialvalue, the estimates obtained may be discarded and it may be equivalentto starting calibration afresh. Thus, P may be reset based onorientation entropy that captures how many unique positions have beenreceived by the filter. This may prevent very long calibration times,and capture the filter history accurately.

Filter Reset During Impossible Values

In some embodiments, the estimated states may be monitored and if theoffsets are larger than 500 mg in open or closed loop or scale factorsgreater than 40%, the filter may be reset to the initial state. Highthresholds may be used because if the real offsets and scale factors arehigh, the open loop results may have a large error due to non-linearity.The cause of error may be attributed to either incorrect Kalman Filterestimation due to lack of diverse positions or sensor faults. In eithercase, the filter may be reset.

Lower Bound on Orientation Entropy

The orientation entropy can become small if the same orientation isrepeated too often compared to others. Thus, a minimum orientationentropy threshold is used to avoid very low values of entropy during Preset at the time of closure.

Number of Outliers Monitoring

An outlier measurement may be defined as a measurement that causes thefilter residual to become abruptly high. In theory, error residuals havea zero mean and a small standard deviation. In practice, the residualscan have non-zero mean and are large initially. As more and moremeasurements are processed, and the loop closure occurs these residualsmay become small. After gaining confidence in the filter performance(i.e. after the first set of results are published by the decisionmonitor), increase in residuals could indicate issues in the filteroperation. If several measurements in recent past cause the errorresiduals to be larger than k*error covariance (3 sigma tests), it couldbe indicative of one of the following:

1. Faulty sensors—Drift of the estimated parameters, spikes in data,etc.

2. Feedback error—Errors propagated due to incorrect feedback

3. Filter divergence—for an unknown reason or instability, the estimatedparameter diverges

In the event of detecting such behavior after the results are published,the algorithm may reset the filter state to the values estimated duringthe first publishing.

Residuals Before and after Loop Closure

The moving average error residuals are monitored before and after loopclosure. If the residual errors increase after closure, this mayindicate incorrect feedback. The filter is then re-initialized to thestate before loop closure, and the algorithm may resume processing newaccelerometer data.

FIG. 13 is a simplified flow diagram illustrating a non-limiting methodperformed by embodiments of the invention for scheduling an execution ofa task on a computing device 2000. The process 1300 is performed byprocessing logic that comprises hardware (circuitry, dedicated logic,etc.), software (such as is run on a general purpose computing system ora dedicated machine), firmware (embedded software), or any combinationthereof. In one embodiment, the process 1300 is performed by one or morecomputing devices 2000 as described in FIG. 20.

Referring to exemplary FIG. 13, at block 1302, components of the deviceperforming embodiments of the invention may receive a plurality ofcalibration measurements. In one embodiment, determining a degree towhich the plurality of calibration measurements were captured atdifferent orientations may include binning each of the plurality ofcalibration measurements into at least one orientation bin of aplurality of orientation bins. In one implementation, each orientationbin of the plurality of orientation bins corresponds to orientationmeasurements captured within a pre-determined degree increment (e.g., 5degree increment). In another embodiment, determining the degree maycomprise calculating an entropy indicative of a range or variance oforientations at which the calibration measurement were captured. In yetanother embodiment, orientation histograms may be used to gauge thediversity of the calibration data. The one or more calibrationparameters may be updated using a filter. In one implementation, thefilter may be a Kalman Filter.

At block 1304, embodiments of the invention may determine a degree towhich the plurality of calibration measurements were captured atdifferent orientations. In one embodiment, determining the degree towhich the plurality of calibration measurements were captured atdifferent orientations may comprise calculating an orientation entropyvalue for a plurality of measurements. And at block 1306, embodiments ofthe invention may determine, based on the degree, whether to update oneor more calibration parameters.

In one implementation, in response to determining that the orientationentropy exceeds a predetermined threshold, embodiments of the inventiondetermine to update the one or more calibration parameters. In oneimplementation, in response to determining that the orientation entropyis below a predetermined threshold, embodiments of the invention discardthe captured measurement without updating the one or more calibrationparameters. In another implementation, in response to determining thatthe orientation entropy is below a predetermined threshold, embodimentsof the invention may use the captured measurement for reducing the noisein the captured measurements without updating the one or morecalibration parameters.

It should be appreciated that the specific steps illustrated in FIG. 13provide a particular method of switching between modes of operation,according to an embodiment of the present invention. Other sequences ofsteps may also be performed accordingly in alternative embodiments. Forexample, alternative embodiments of the present invention may performthe steps outlined above in a different order. To illustrate, a user maychoose to change from the third mode of operation to the first mode ofoperation, the fourth mode to the second mode, or any combination therebetween. Moreover, the individual steps illustrated in FIG. 13 mayinclude multiple sub-steps that may be performed in various sequences asappropriate to the individual step. Furthermore, additional steps may beadded or removed depending on the particular applications. One ofordinary skill in the art would recognize and appreciate manyvariations, modifications, and alternatives of the process.

FIGS. 14A-14C illustrate various aspects of the example calibrationmethod in greater detail according to one or more illustrative aspectsof the disclosure. Various portions of the example calibration methodillustrated in these figures will be described in the followingpassages. As discussed in additional detail herein, the steps of themethod illustrated in FIGS. 14A-14C may be performed by the calibrationmodule 410, and each of the identified elements in these figures may beimplemented as a sub-module or element within the calibration module.

Stationary Detection:

This module establishes whether a sample is part of a stationary periodor not. The criteria used to determine stationarity might be based onaccelerometer data only. Stationarity may be established as part of theauto-calibration algorithm by putting an upper bound on theaccelerometer norm, standard deviation or the vector gradient of theaccelerometer magnitude. It may be desirable that the information isavailable on a per sample basis, since embodiments of the invention mayrely on fixed length stationary segments, and maintain a moving sum ofthe samples till the end of a stationary period. It is understood thatthere could be delays involved in the signaling depending on the windowsize used to establish stationarity. It would therefore be advantageousto know when the state changes from STATIONARY to MOTION in order toavoid using samples that are part of the motion. The algorithm discardssome samples from the beginning and the end of the stationary periodretroactively to avoid the above problem.

In addition, for the auto-calibration algorithm absolute stationaritymight not be essential. In fact, in some scenarios, using absolutelystationary segments may delay the algorithm convergence. Embodiments ofthe invention rely on data during ‘regular usage’ of the phone tocalibrate automatically without knowledge of phone orientation. Forexample, holding the phone during a call, dialing, looking at thedisplay, in pocket while sitting or standing, etc. are all motion typesthat can be used for calibration. Thus, stationarity may includesubstantially stationary positions for embodiments of the inventiondiscussed herein and stationarity may be used in a ‘loose’ sense, inorder to avoid long calibration times.

II-B. Data Processing and Feature Creation

Transforming input data into the set of features is called featureextraction. Feature extraction may be used to reduce the amount of datapresented to an algorithm. For auto-calibration, the feature extractionscheme may involve computing the: mean and variance of vectoracceleration, scalar acceleration, measurement as the difference in thescalar acceleration and Gravity, and finally measurement variance as afunction of the vector acceleration variance.

Mean & Variance Computation:

If the incoming samples are determined to be part of the currentstationary segment, the sample may be incorporated into the segment meanand variance computation. Each stationary segment may typically consistof several samples.

If a stationary segment is assumed to have n samples, the mean and theaverage variance of the data may be calculated as shown below:

$\begin{matrix}{a_{x} = {\frac{1}{n}{\sum\limits_{i = 1}^{n}a_{x,i}}}} & (1) \\{a_{y} = {\frac{1}{n}{\sum\limits_{i = 1}^{n}a_{y,i}}}} & (2) \\{a_{z} = {\frac{1}{n}{\sum\limits_{i = 1}^{n}a_{z,i}}}} & (3)\end{matrix}$The variance on each of the axes may be calculated as:

$\begin{matrix}{\sigma_{x}^{2} = {\frac{1}{n}{\sum\limits_{i = 1}^{n}\left( {a_{x,i} - a_{x}} \right)^{2}}}} & (4) \\{\sigma_{y}^{2} = {\frac{1}{n}{\sum\limits_{i = 1}^{n}\left( {a_{y,i} - a_{y}} \right)^{2}}}} & (5) \\{\sigma_{z}^{2} = {\frac{1}{n}{\sum\limits_{i = 1}^{n}\left( {a_{z,i} - a_{z}} \right)^{2}}}} & (6)\end{matrix}$

A recursive implementation of the mean and variance may be used in orderto avoid buffering the samples. A minimum and a maximum limit on thenumber of samples that belong to the same stationary segment may beused. The minimum limit on number of samples may be desirable in orderto compute variance reliably. The limit on the maximum number of samplesmay be used to avoid summing data for long periods to prevent overflows.

Measurement Computation

The measurement may be defined as the difference between the magnitudeof the mean acceleration and gravity. To avoid the square rootoperation, the squared magnitude difference may be used. The measurementmay be defined as:z=a _(x) ² +a _(y) ² +a _(z) ² −g ²  (7)

Here, a_(x) a_(y) and a_(z) are the mean acceleration on each axiscomputed as shown in the previous section. This measurement may bemodeled in terms of offsets and scale factors as:z=(x ₀(1+x _(SF))+x _(OFF))²+(y ₀(1+y _(SF))+y _(OFF))²+(z ₀(1+z_(SF))+z _(OFF))² −g ²  (8)where x₀ is the true acceleration, x_(SF) is the scale factor error inthe x acceleration. x_(OFF) is the offset error in the x acceleration.Similar notation may be used for they and z axes.Measurement Variance Computation

The variance of the mean of the measurement ‘z’ can be modeled as shownbelow:

$\begin{matrix}{{{var}(z)} = {{var}\left( {a_{x}^{2} + a_{y}^{2} + a_{z}^{2} - g^{2}} \right)}} \\{= {{{var}\left( a_{x}^{2} \right)} + {{var}\left( a_{y}^{2} \right)} + {{var}\left( a_{z}^{2} \right)}}}\end{matrix}$assuming that the accelerations of the 3 axes are uncorrelated. From thepropagation of uncertainty [R3], a relationship between var(a_(x)) andvar(a_(x) ²) can be established.

Consider a real random variable A, with standard deviation σ_(A), and a,b are real-valued constants. The variance of a function ƒ=A^(+b) interms of the variance of the real variable may be given by:

$\frac{\sigma_{f}}{f} = {b\;\frac{\sigma_{A}}{A}}$

In one scenario, b=2 and hence ƒ=a_(x) ². Thus, var(a_(x) ²)=4 a_(x)²σ_(x) ². Similarly, var(a_(y) ²)=4a_(y) ²σ_(y) ² and var(a_(z)²)=4a_(z) ²σ_(z) ². Thus, the variance of the measurement in terms ofthe component variances may be calculated as:var(z)=4a _(x) ²σ_(x) ²+4a _(y) ²σ_(y) ²+4a _(z) ²σ_(z) ²  (9)II-C. Kalman Filter Design

The Kalman Filter may be an estimator for obtaining the instantaneousstate of a linear dynamic system perturbed by white noise. This may bedone by using measurements linearly related to the state but corruptedby white noise. Kalman Filter is may be used to estimate the offsets andscale factors recursively. The details of the Kalman Filter working anddesign are given below.

Generalized System Model

In the state-space model, a discrete time system is often represented bythe equation shown below.x _(k) =a _(k) x _(k-1) +bu _(k) +w _(k-1), where the followingterminology may be used:

x_(k) denotes the system state and can be a vector,

k denotes the time,

a_(k) and b are constants,

u_(k) denotes the control input, and

w_(k) denotes the process noise.

The process noise may be assumed to be white, with 0 mean and covarianceQ and uncorrelated with the input.p(w)=N(0,Q)

Now, in one scenario, it may be difficult to determine the signal ofinterest x directly, and the measured value z is a linear function of xas shown below:z _(k) =Hx _(k) +v _(k)  10)

Here, H is the observation matrix or the gain matrix and v_(k) is themeasurement noise. The noise may be assumed to be white with 0 mean andcovariance, and may be uncorrelated with the input or the process noise.p(v)=N(0,R)

Given a linear system as described above, the Kalman Filter filters z soas to estimate x, while minimizing the effects of noise w & v. TheKalman Filter simply reproduces the system model and uses the errorbetween the current measurement and the predicted value (based onprevious measurements) to correct the estimates.

FIG. 15 illustrates an example of a Kalman Filter according to one ormore illustrative aspects of the disclosure.

Simplified Model for Auto-Calibration Algorithm

Following assumptions may be made in one scenario: a_(k)=1, u_(k)=0,w_(k)=0. Thus, the linear system model may be reduced to the followingequations:x _(k) =x _(k-1) with dimensions 6×1z _(k) =Hx _(k) +v _(k) with dimensions 1×1 and H has dimensions −1×6p(v)=N(0,R _(k))  (11)z is the measurement computed from equation  (7)

Here, R_(k) is the variance of the measurement z_(k) and may be computedas shown in equation (9).

In simple terms, the estimate of the last state is the current state andthere may be no control input or process noise in our system. Theprocess noise is assumed to be non-zero when the estimated parametersvary with time. The offsets and scale factors may be assumed to beconstant with time, and may vary only due to temperature. Thetemperature compensation scheme may be designed outside of the KalmanFilter and thus may assume no process noise. The details on temperaturecompensation may be described below.

State Vector

The state vector consists of the parameters to be estimated namely, theoffsets and scale factors on all 3 axes.

$\begin{matrix}{x = \begin{bmatrix}x_{OFF} \\y_{OFF} \\z_{OFF} \\x_{SF} \\y_{SF} \\z_{SF}\end{bmatrix}} & (12)\end{matrix}$

The state vector may be,

Observation Matrix

A linear relationship may be assumed between the estimated states andthe measurement. H may be the transition matrix and may be comprised ofpartial derivatives of the measurement with respect to the estimatedstate. Since in this case x and z are 6*1 and 1*1 vectors, the H matrixdimensions are [6*1]. Using z modeled as shown in equation (8), thepartial derivatives may be calculated with respect to the states shownbelow:∂z/∂x _(OFF)=2x ₀(1+x _(SF))+x _(OFF)˜2a _(x)∂z/∂y _(OFF)=2y ₀(1+y _(SF))+y _(OFF)˜2a _(y)∂z/∂z _(OFF)=2z ₀(1+z _(SF))+z _(OFF)˜2a _(z)∂z/∂x _(SF)=2(x ₀(1+x _(SF))+x _(OFF))·x ₀˜2a _(x) ²∂z/∂y _(SF)=2(y ₀(1+y _(SF))+y _(OFF))·y ₀˜2a _(y) ²∂z/∂z _(SF)=2(z ₀(1+z _(SF))+z _(OFF))·z ₀˜2a _(z) ²H=[2a _(x)2a _(y)2a _(x) ²2a _(y) ²2a _(z) ²]  13)

Here, a_(x) a_(y) a_(z) may be computed as shown in equations, and

$a_{z} = {\frac{1}{n}{\sum\limits_{i = 1}^{n}{{a_{z,i}{()}}.}}}$Note that x₀ is the true acceleration, x_(SF) is the scale factor errorin the x acceleration, x_(OFF) is the offset error in the xacceleration. Similar notation may be used for the y and z axes.

The relationship between the current state and the measurement may berelated by the transition matrix H. The 3 offset related terms may bedirectly proportional to the average acceleration in the 3 axes i.e. thestate may be affected or modified directly with the input acceleration,since the offsets are directly proportional to the accelerationmagnitude on each axis. On the other hand, the scale factor terms (4thto 6th in the matrix) may vary proportionally to squared acceleration(approximately). Since scale is a multiplicative term to theacceleration, it may vary proportionally to the measurement (squaredmagnitude of acceleration).

The states might not vary linearly with the measurement, and the modelmay be inaccurate if the offset and scale factor errors are large. Itmay be desirable to reduce the non-linearity errors by closing the loop(using feedback) and by normalizing the H matrix, as discussed in moredetail below.

Computing “R”

The variance of the measurement may be directly used as the noise in theKalman Filter. In an alternative approach, the computed variance may bedivided by the number of samples in the stationary period. The reductionin noise magnitude could be attributed to the large number of stationarysamples in the segment. But, this could give highly optimistic resultssince averaging does not help mitigate the errors due to resolution. Ingeneral, the noise in the segments may be small owing to thestationarity condition. Thus, R equal to the variance of themeasurement, may be used, as shown in Equation (9)

Prediction and Correction Phases

The Kalman Filter works in 2 steps:

Step 1—Time Update or Predictor Phase

The time update equations are responsible for projecting forward (intime) the current state and error covariance. Given the initialestimates {circumflex over (x)}_(k-1) and P_(k-1), this step maycalculate the next estimate of the state based on the past measurementsof the output. Here, a priori covariance matrix may be initialized tothe variance of the initial state.

The a priori covariance may also be calculated as shown below.{circumflex over (x)} _(k) ⁻ ={circumflex over (x)} _(k-1)  (14){circumflex over (P)} _(k) ⁻ =P _(k-1)  (15)Step 2—Measurement Update or Correction Phase

In this step, an attempt may be made to correct the a priori estimate.The Kalman gain may be the blending factor that aims to minimize the aposteriori error covariance and may be used to refine the a prioriestimate to give ‘a posteriori’ estimates as shown below:

$\begin{matrix}{K_{k} = \frac{P_{k}^{-}H^{T}}{{HP}_{k}^{-}\left( {{{HP}_{k}^{-}H^{T}} + R} \right)}} & (16) \\{{\hat{x}}_{k} = {{\hat{x}}_{k}^{-} + {K_{k}\left( {z_{k} - {H{\hat{x}}_{k}^{-}}} \right)}}} & (17)\end{matrix}$

The term z_(k)−H{circumflex over (x)}_(k) ⁻ is also called themeasurement innovation or residual, since it reflects the discrepancybetween the predicted and the actual measurement. The a posterioricovariance may be computed as:P _(k)=(I−K _(k) H)P _(k) ⁻  18)

Significance of Kalman Gain

If the a priori error is small, the gain K may be small, so thecorrection applied may be small. In other words, the current measurementmay be nearly ignored and only past estimates form the new estimate.This is logical since if the a priori estimate is good, there is littleneed to correct it

If the a priori error is large, the measurement noise term R may not beimportant, then K=1/H. Thus, the a priori estimate may be discarded andthe current measurement may be used to estimate the state

If the measurement noise R is large, K may be small so the currentmeasurement may be ignored and the estimate may depend more on the pastestimates

II-D. Feedback Monitor

The feedback monitor is the module that monitors the covariance matrix,per axis entropy and the residuals before using the estimated parametersin feedback. The feedback monitor checks the elements of the aposteriori covariance matrix (P) until the variance of the stateestimate goes below a threshold. The condition may be checked for eitherall offsets or all scale factors. Thus, if any of the offsets do nothave a small error variance, the offset loop closure might not happen.Similarly, if any of the scale factors do not meet the variancerequirements, the scale factor closure might not succeed.

In addition, the orientation entropy (defined below) of the individualaxis may be monitored in order to make sure that each axis has undergoneenough diverse motions. This may be an extra precaution taken in orderto avoid feedback of the calibration parameters prematurely (since P isover-optimistic, as explained below). As an example, if the phone isplaced in the Z-up position, and rotated continuously for several weeks,the variance terms for all 3 axes will reach the feedback threshold.Once this happens, the current calibration estimate may be applied tothe incoming accelerometer data. This may result in propagation of errorvia feedback, and may result in longer recovery time to calibrate.Please note, in either case, the results might not be published due to acombination or metrics used at the Decision Monitor.

The reason to apply the current estimated parameters is to avoid thelarge errors in the estimate due to a non-linear relationship betweenthe measurement and the estimated KF states (offsets and scale factors).

Using Independent 3-State KF to Estimate Offsets

The KF has been designed with a new measurement that uses the differencein magnitudes of consecutive stationary segments. Using this newmeasurement, a 3-state KF can run in parallel to the current method andused to compute the offsets. Computing offsets instead of scale factorsmay be advantageous since scale factors are not observable. Theadvantage of using this approach is that we do not see errors due tonon-linearity. Thus, these offsets may be used to benchmark the offsetsestimated from the 6-state KF. In another implementation, a 3-state KFis utilized in the beginning to calibrate the offsets, followed by the6-state KF to compute scale factors.

Passive Calibration for Initialization

Any other method that independently computes the offsets and scalefactors could be used for comparison of the calibration data. Forexample, if we compute the offsets and scale based on monitoring thelong term minima and maxima, the results from the two algorithms couldbe used to understand reliability the reliability of the calibrationdata.

Provide ‘Intelligent Publishing’

In the long term, if the user behavior is not conducive to calibrationconvergence (i.e. the user does not actively use the phone), method ofthe invention can provide instructions on what kinds of motions to beperformed and on which axis for convergence to expedite. This may bebased on the orientation entropy of the axis.

Sensor Fault Detection

Embodiments of the invention may also implement sensor fault detectionusing residual monitoring and closed loop estimates. For example, if thecalibration algorithm resets continuously, this may be used to identifyfaulty sensors

III. Temperature Compensation Module

In a computing device 2000, for a filter, such as the Kalman Filter(KF), the offset and scale factors for calibration of the sensors arefairly constant over time for a given temperature. However, the offsetand scale factors may drift with temperature changes over a fulltemperature range resulting in output that may show significant variancefrom the actual orientation and motion associated with the computingdevice 2000. For example, a change in ambient temperature of 5-10 degreeC. can cause errors ranging from 2.5 mg to 5 mg. Calibrating offset andscale factors over a full temperature range may substantially increasethe accuracy for the sensors operating at various temperatures.

Embodiments of the invention propose creating a look-up table forstoring the calibration parameters that correspond to differenttemperature ranges. The look-up table may be stored in the storagedevice 2025 in the computing device 2000. The look-up table may storethe accelerometer offsets, scale factors their quality estimates and thereliability flag. A sample table is shown below.

Sample temperature look-up table Stored Scale Error Reli- Value Offsetsfactors covariance ability Number Temp range (mg, scalars) (%, scalars)matrix Flag of KF (deg C.) x y z x y z (6 × 6) (1 or 0) updates DEFAULT1 −20 to −10 0 −10 to 0 1 0 to 10 1 10 to 20 0 . . . 0

The temperature of the operating environment of the motion sensor may beacquired by either a dedicated temperature sensor in the vicinity of themotion sensor or a multi-purpose temperature sensor in the vicinity ofthe motion sensor. It is desirable to have the temperature sensorcollecting temperature data at a rate of 5 Hz or faster for betteraccuracy. The operating temperature range for the motion sensor, such asan accelerometer, may be obtained from the data sheets provided by themanufacturer of the sensor or determined through experimentation.

The temperature bin sizes in the table may be based on the temperaturecoefficients for the accelerometer offset and scale factors. In oneimplementation of the table, for the worst case scenario, the larger ofthe 2 coefficients (i.e. max (offset_temp_coefficient,scale_factor_temp_coefficient)), may be chosen as the bin size. Equalsized bins of 5 degree C. may be chosen for some sensors.

Updating Multiple Kalman Filter Parameters using a Single Measurement

For every sensor data and temperature pair received, the temperaturemodule may update two instances of the KF (one for each temperaturebin). Updating two KF bins may be advantageous since it expeditescalibration convergence. By updating two bins for each measurement, eachpossible sensor measurement is used to update at least the ambienttemperature results and also provide faster results at the currentoperating temperature of the sensor. For a measurement that is attemperature T≠Tamb (where Tamb is ambient temperature), the bin attemperature T may be updated. In addition, the bin at Tamb may also beupdated using the same measurement but processed with a high measurementnoise. Associating a measurement noise with the measurement allows fortemperature module to associate a weight with each measurement for theKalman Filter. In each case, the measurement noise is calculated basedon the distance of the current temperature from the bin center of theambient temperature and may be represented by the following formula:R _(k) =R _(k) +c*((T−T _(amb))*tempCo)²

Thus, the default KF at Tamb may be updated with the new measurementwith a high measurement noise since it is further away from the centerof the current bin of T. The KF bin for T may also have a smallmeasurement noise based on the distance between the temperature for themeasurement T and the center of the current bin for temperature T. Asshown in the above equation, a constant may be multiplied to account forthe worst case errors due to both the offsets and the scale factors. Inone implementation, the constant is 4.

Interpolation for Empty Bins

In embodiments of the invention, when the calibration is done withsufficient accuracy, the offsets and scale factors may be copied to thedefault temperature bin and the current temperature bin along withcorresponding noise parameters described above. In one aspect, if at thetime of update the table cell already contains previous calibrationresults, the new and old values may be weighted averaged. Ideally, itwould be safe to over-write the previous calibration results, but inorder to avoid skewing the results if an erroneous value is reported,the values may be averaged. For proper weighting, each table cell shallalso contain the number of KF updates for this cell done over phone lifetime. The weight for the current KF update may then be accordinglyadjusted before averaging out the value of the table cell.

The entries in the look-up table may be dynamically and continuouslyupdated throughout the lifespan of the computing device. As thecomputing device 2000 is used, the table is populated and the accuracyof the data represented by the table increases. However, when thecomputing device is first used the look-up table may be sparselypopulated. If the table cell for a current phone temperature is empty,the accelerometer offset and scale factor may be approximated. In oneaspect, linear interpolation of the offsets and scale factors fromnearest available cells at higher and lower temperature may be used, ifboth higher and lower cells are available. The corresponding variancescan also be interpolated accordingly. If two or more nearest cells forthe interpolation are unavailable, the variance may be increased. In oneimplementation, the variance is increased according to the followingequation:var(T)=var(T ₁)+((T ₁ −T)*temp_coeff)²

Extrapolation outside of available temperature range is not desirablebecause dependence on temperature may or may not be linear, and in caseof non-linearity the extrapolation may result in erroneous results. Thecalibration accuracy is limited by the finite temperature bin size ofthe table. There may be a trade-off between the bin size and calibrationtime. If the bins are smaller (better accuracy), the calibration timebecomes longer since fewer and fewer measurements are part of the samebin.

FIG. 16 is a simplified flow diagram illustrating a non-limiting methodperformed by the temperature compensation module of the computing device2000. The process 1600 is performed by processing logic that compriseshardware (circuitry, dedicated logic, etc.), software (such as is run ona general purpose computing system or a dedicated machine), firmware(embedded software), or any combination thereof. In one embodiment, theprocess 1600 is performed by one or more computing devices 2000 asdescribed in FIG. 20.

At block 1605, once the calibration module calculates the calibrationoffset and the calibration scale factor and the reliability flag is setthe calibration data is published. At block 1610, the look-up table isupdated corresponding to the current measured temperature. The processof updating the table was discussed in FIG. 15 in more detail. At block1615, the calibration time is also updated for future use.

It should be appreciated that the specific steps illustrated in FIG. 16provide a particular method of switching between modes of operation,according to an embodiment of the present invention. Other sequences ofsteps may also be performed accordingly in alternative embodiments. Forexample, alternative embodiments of the present invention may performthe steps outlined above in a different order. To illustrate, a user maychoose to change from the third mode of operation to the first mode ofoperation, the fourth mode to the second mode, or any combination therebetween. Moreover, the individual steps illustrated in FIG. 16 mayinclude multiple sub-steps that may be performed in various sequences asappropriate to the individual step. Furthermore, additional steps may beadded or removed depending on the particular applications. One ofordinary skill in the art would recognize and appreciate manyvariations, modifications, and alternatives of the process.

FIG. 17 is a simplified flow diagram illustrating a non-limiting methodperformed by the temperature compensation module of the computing device2000 for updating the temperature compensation look-up table with sensorcalibration information.

FIG. 16 is a simplified flow diagram illustrating a non-limiting methodperformed by the temperature compensation module of the computing device2000. The process 1600 is performed by processing logic that compriseshardware (circuitry, dedicated logic, etc.), software (such as is run ona general purpose computing system or a dedicated machine), firmware(embedded software), or any combination thereof. In one embodiment, theprocess 1600 is performed by one or more computing devices 2000 asdescribed in FIG. 20.

FIG. 17 describes a look-up table for acceleration information from anaccelerometer; however, similar techniques may be used for other sensorsas well. At block 1605, once the calibration module calculates thecalibration offset and the calibration scale factor and the reliabilityflag is set the calibration data is published. At block 1610, thelook-up table is updated corresponding to the current measuredtemperature. The process of updating the table was discussed in FIG. 15in more detail. At block 1615, the calibration time is also updated forfuture use.

At block 1702, new acceleration data is received from the sensors. Thecalibration module may use the new acceleration to calibrate thesensors. In one implementation, at decision block 1706, if the defaultreliability flag is set than the results may be published (block 1708).If the initial calibration step, at 1704 is not complete than thecurrent temperature may be sensed (block 1710). In one aspect, thecurrent temperature is sensed using a temperature sensor that is in thevicinity of the accelerometer. In one implementation, it may bedesirable that the temperature sensor provides information at a rate of5 Hz or faster for better accuracy. Once the temperature is measured, atdecision blocks 1712[a, b, c, n], the measured temperature for thecurrent reading may be compared against the different temperature bins.Once the temperature bin is found (as shown in 1712 a and 1714 a), the Pand the X values are loaded. At block 1716, auto-calibration is run andthe calibration is checked again (at block 1704). At block 1718 and1720, after the auto-calibration is run, the table is updated with thenew P, X and RFLAG values according to the temperature bins determinedin decision block 1712. The above steps are exemplary steps forgenerating calibration data and specific steps may be changed orcompletely removed or substituted without departing from the scope ofthe invention.

Embodiments of the invention may also perform sophisticated temperaturecalibration techniques that can compute temperature coefficients duringcharging or ambient temperature changes and also use vendor data sheetsto model temperature curve, and incorporate in the model discussedabove.

In another embodiment, instead of just storing the calibration data forthe temperature (or temperature bin), embodiments of the invention maystore the calibration data for various orientations at each temperature(or temperature bin). And the calibration data for the temperature maybe generated using the calibration data associated with the variousorientations at each temperature. In some instances, interpolatingcalibration data for one or more orientations at a given temperature mayyield better overall calibration. Interpolating the calibration data forthe one or more orientations increases the entropy of the calibrationdata at that temperature may therefore yield better results thandirectly interpolating calibration data for a given temperature, asdiscussed in FIG. 17.

It should be appreciated that the specific steps illustrated in FIG. 17provide a particular method of switching between modes of operation,according to an embodiment of the present invention. Other sequences ofsteps may also be performed accordingly in alternative embodiments. Forexample, alternative embodiments of the present invention may performthe steps outlined above in a different order. To illustrate, a user maychoose to change from the third mode of operation to the first mode ofoperation, the fourth mode to the second mode, or any combination therebetween. Moreover, the individual steps illustrated in FIG. 17 mayinclude multiple sub-steps that may be performed in various sequences asappropriate to the individual step. Furthermore, additional steps may beadded or removed depending on the particular applications. One ofordinary skill in the art would recognize and appreciate manyvariations, modifications, and alternatives of the process.

FIG. 18 is a simplified flow diagram illustrating a non-limiting methodperformed by the temperature compensation module of the computing device2000 for generating calibration data for a temperature. Aspectsdiscussed with respect to FIG. 16 and FIG. 17 may be combined ormodified to include aspects discussed below with respect to FIG. 18. Theprocess 1800 is performed by processing logic that comprises hardware(circuitry, dedicated logic, etc.), software (such as is run on ageneral purpose computing system or a dedicated machine), firmware(embedded software), or any combination thereof. In one embodiment, theprocess 1800 is performed by one or more computer systems 2000 asdescribed in FIG. 20. In one embodiment, the sensors 2050 acquire thesensor input for further processing by filtering and processing bycomponents of the device described in FIG. 20.

At block 1802, embodiments of the invention, using a temperature sensor2070, detect the temperature of the operating environment for a sensorcoupled to the computing device 2000. In one embodiment, the at leastone orientation may have no sensor measurement data associated with theat least one orientation at the detected temperature. The sensor 2050may include inertial or motion sensors, such as accelerometers 2055,gyroscopes 2060, or magnetometers 2065. For accelerometer 2055,calibration data may comprise a sensor offset and/or a sensitivity.

At block 1804, embodiments of the invention determine the entropyassociated with the stored sensor measurement data at or near thedetected temperature. In one embodiment, a temperature bin may be usedto group the sensor measurement data at or near the detectedtemperature. The temperature bin may be a range of temperaturesidentified for combining calibration data for the one or moreorientations for that range. Once the temperature is detected at block1802, a temperature bin may be identified from a plurality oftemperature bins for the sensor using the detected temperature. Theprocessor 2010 may calculate the diversity associated with the sensormeasurement data associated with the one or more orientation positionsat the detected temperature. In one embodiment, the diversity of thesensor measurement data may be gauged by calculating the entropyassociated with the sensor measurement data. In another embodiment, anorientation histogram may be used to determine the diversity associatedwith the data. However, in another embodiment, the computing devicestores the pre-calculated entropy in memory 2035 for each temperaturebin for quicker access.

At block 1806, embodiments of the invention determine if the diversityassociated with the stored sensor measurement data for the temperatureis below a threshold. The threshold may be pre-determined and static ordynamically set by components of the device. If the entropy associatedwith the calibration data for the various orientations is higher thanthe threshold, then the computing device 2000 may generate thecalibration data for the temperature bin, at block 1810.

At block 1808, in response to determining that the entropy associatedwith the stored calibration data for the temperature is below athreshold, components of the computing device 2000 may use sensormeasurement data from another temperature for increasing the diversityassociated with the plurality of measurement data for the detectedtemperature. In one embodiment, using sensor measurement data fromanother temperature may include lowering the weight associated with thesensor measurement data from another temperature bin by adjusting theparameters of a filter associated with the temperature bin. In oneembodiment, lowering the weight associated with the sensor measurementdata from another temperature bin may include using noise with theborrowed sensor measurement data from another temperature bin.

In one embodiment, using sensor measurement data from anothertemperature may include linearly interpolating sensor measurement datafor at least one orientation at the temperature bin for the detectedtemperature using the sensor measurement data from the temperature binswith higher and/or lower temperatures than the current temperature binfor the detected temperature. Linearly interpolating sensor measurementdata may include using the sensor measurement data from the temperaturebins with higher and/or lower temperature than the current temperaturebin and a pre-determined slope of a change in sensor measurement datawith respect to a change in temperature for deriving the sensormeasurement data for the orientation for the identified temperature bin.The slope or the temperature coefficients may be determined by detectingtime intervals when the computing device is stationary as it experienceschange in temperature. In one embodiment, the determination of the slopeof change in the sensor measurement data with respect to the change inthe temperature may occur during the normal use of the computing device2000, for example, while the computing device 2000, such as a phone ischarging (stationary 6-10 hours). Since the orientation of the computingdevice 2000 does not change, the sensor offset and the temperaturecoefficients may be computed by the temperature compensation module byobserving the change in the sensor reading per change in temperature.The ratio generated may be used as the temperature coefficient. Oneadvantage is that such temperature compensation may not the computingdevice 2000 to warm-up in diverse phone orientations and simply thechange in temperature while the device is in one position may besufficient. Once the temperature coefficient has been computed, veryaccurate interpolation may be performed using the adjacent temperaturebins. If enough temperature coefficients over a wide range oftemperatures are computed, in some implementations, the calibrationresults at the current and nearby temperatures may be obtainedsimultaneously.

In addition to interpolating the sensor measurement data for anorientation, in some embodiments, the one or more processors 2010 mayupdate the one or more orientations missing sensor measurement data atthe identified temperature in memory 2035 using the interpolated orborrowed sensor measurement data.

At block 1810, embodiments of the invention, using one or moreprocessors 2010, generate the calibration data for the sensor for thedetected temperature using at least the borrowed or interpolated sensormeasurement data for the detected temperature bin. In one embodiment,each temperature bin may be associated with a respective filter. In oneimplementation, the one or more processors 2010 may generate thecalibration data for the identified temperature by updating the filterusing the borrowed or interpolated sensor measurement data associatedwith the at least one orientation. The borrowed or interpolated sensormeasurement data associated with the at least one orientation may beinput to the filter with a parameter indicating lower confidence for theborrowed or interpolated sensor measurement data than other sensormeasurement data from other orientations from the same temperature bin.This may have the effect of weighing the borrowed or interpolated sensormeasurement data lower than the other sensor measurement data in thefilter. In some embodiments, an adjustable filter such as a KalmanFilter is used in embodiments of the invention.

It should be appreciated that the specific steps illustrated in FIG. 18provide a particular method of switching between modes of operation,according to an embodiment of the present invention. Other sequences ofsteps may also be performed accordingly in alternative embodiments. Forexample, alternative embodiments of the present invention may performthe steps outlined above in a different order. To illustrate, a user maychoose to change from the third mode of operation to the first mode ofoperation, the fourth mode to the second mode, or any combination therebetween. Moreover, the individual steps illustrated in FIG. 18 mayinclude multiple sub-steps that may be performed in various sequences asappropriate to the individual step. Furthermore, additional steps may beadded or removed depending on the particular applications. One ofordinary skill in the art would recognize and appreciate manyvariations, modifications, and alternatives of the process.

Cross-Axis Sensitivity

In the manufacturing process for the sensors, the sensors are calibratedto the X, Y and Z coordinate axis system, wherein the axes arerelatively perpendicular to each other. However, due to manufacturingdefects the axes are not always perpendicular to each other. Anyvariance in one axis causes cross-axis variance in all the axes in thecoordinate system, since the calculations are based of the premise thatthe three axes are perpendicular to each other. Techniques in sensorfusion allow checking the measurements across multiple sensors anddetecting the variance in the sensor calibration. Once the variance inthe sensor calibration due to manufacturing defects is detected, thevariance for that axes can be compensated for in the futurecalculations. FIG. 19 illustrates an example method of compensating forcross-axis sensitivity due to manufacturing defects. At block 1905, thecomputing device 2000 or modules of the computing device detectcross-variance for an axis using sensor data from multiple sensors. Atblock 19, a cross-variance offset is calculated for the axis using datafrom multiple sensors and the assumption that all axes are perpendicularto each other. At block 1915, the cross-variance offset is used in allcalculations and filters to compensate for the cross-variance offset ofthe axis.

VI. Example Computing System

Having described multiple aspects of accelerometer auto-calibration, anexample of a computing system in which various aspects of the disclosuremay be implemented will now be described with respect to FIG. 20.According to one or more aspects, a computer system as illustrated inFIG. 20 may be incorporated as part of a computing device, which mayimplement, perform, and/or execute any and/or all of the features,methods, and/or method steps described herein. For example, computersystem 2000 may represent some of the components of a hand-held device.A hand-held device may be any computing device with an input sensoryunit, such as a camera and/or a display unit. Examples of a hand-helddevice include but are not limited to video game consoles, tablets,smart phones, and mobile devices. In one embodiment, the system 2000 isconfigured to implement the computing devices described in FIGS. 1 and2. FIG. 20 provides a schematic illustration of one embodiment of acomputing device 2000 that can perform the methods provided by variousother embodiments, as described herein, and/or can function as the hostcomputer system, a remote kiosk/terminal, a point-of-sale device, amobile device, a set-top box, and/or a computer system. FIG. 20 is meantonly to provide a generalized illustration of various components, anyand/or all of which may be utilized as appropriate. FIG. 20, therefore,broadly illustrates how individual system elements may be implemented ina relatively separated or relatively more integrated manner.

The computer system 2000 is shown comprising hardware elements that canbe electrically coupled via a bus 2005 (or may otherwise be incommunication, as appropriate). The hardware elements may include one ormore processors 2010, including without limitation one or moregeneral-purpose processors and/or one or more special-purpose processors(such as digital signal processing chips, graphics accelerationprocessors, and/or the like); one or more input devices 2015, which caninclude without limitation a camera, a mouse, a keyboard and/or thelike; and one or more output devices 2020, which can include withoutlimitation a display unit, a printer and/or the like.

In addition, computing device 2000 may further include a plurality ofsensors 2050, that may include but are not limited by, one or moreaccelerometers (e.g., accelerometer 2055), one or more gyroscopes (e.g.,gyroscope 2060), and/or one or more magnetometers (e.g., magnetometer2065), as also illustrated in FIG. 2. Accelerometer 2055 may measureand/or provide (e.g., to processor 2010) information about accelerationexperienced by computing device 2000 and/or otherwise sensed byaccelerometer 2055. Gyroscope 2060 may similarly measure and/or provide(e.g., to processor 2010) information about gyroscopic motion (e.g.,changes in orientation) experienced by computing device 2000 and/orotherwise sensed by gyroscope 2060. In addition, magnetometer 2065 maymeasure and provide (e.g., to processor 2010) information regardingmeasurements of and/or changes in magnetic field (e.g., changes inbearing) experienced by computing device 2000 and/or otherwise sensed bymagnetometer 2065. In some embodiments, filters may be implemented inone or more of the sensors discussed above, or implemented as separatehardware or software components, for example as stored in the operatingsystem 2040, application 2045, or other portion of the working memory2035 or the storage device 2025.

The computer system 2000 may further include (and/or be in communicationwith) one or more non-transitory storage devices 2025, which cancomprise, without limitation, local and/or network accessible storage,and/or can include, without limitation, a disk drive, a drive array, anoptical storage device, a solid-state storage device such as a randomaccess memory (“RAM”) and/or a read-only memory (“ROM”), which can beprogrammable, flash-updateable and/or the like. Such storage devices maybe configured to implement any appropriate data storage, includingwithout limitation, various file systems, database structures, and/orthe like.

The computer system 2000 might also include a communications subsystem2030, which can include without limitation a modem, a network card(wireless or wired), an infrared communication device, a wirelesscommunication device and/or chipset (such as a Bluetooth® device, an802.11 device, a WiFi device, a WiMax device, cellular communicationfacilities, etc.), and/or the like. The communications subsystem 2030may permit data to be exchanged with a network (such as the networkdescribed below, to name one example), other computer systems, and/orany other devices described herein. In many embodiments, the computersystem 2000 will further comprise a non-transitory working memory 2035,which can include a RAM or ROM device, as described above.

The computer system 2000 also can comprise software elements, shown asbeing currently located within the working memory 2035, including anoperating system 2040, device drivers, executable libraries, and/orother code, such as one or more application programs 2045, which maycomprise computer programs provided by various embodiments, and/or maybe designed to implement methods, and/or configure systems, provided byother embodiments, as described herein. Merely by way of example, one ormore modules (e.g., scheduling, calibration and temperature modules)described with respect to the method(s) discussed above, for example asdescribed with respect to FIG. 4 and other figures, might be implementedas code and/or instructions executable by a computer (and/or a processorwithin a computer); in an aspect, then, such code and/or instructionscan be used to configure and/or adapt a general purpose computer (orother device) to perform one or more operations in accordance with thedescribed methods.

As noted above, in one or more embodiments, the system 2000 may beconfigured to implement the computing device of FIG. 1 and FIG. 2discussed previously. In these embodiments, hardware componentsdescribed above with respect to FIG. 1 and FIG. 2 may correspond tosimilar components described here with respect to system 2000.Additionally or alternatively, components described above with respectto FIG. 1 and FIG. 2 that might not be described here with respect tosystem 2000 may be added to and/or otherwise incorporated with system2000 (e.g., in a manner similar to how such components may be includedin FIG. 1 and FIG. 2).

A set of these instructions and/or code might be stored on acomputer-readable storage medium, such as the storage device(s) 2025described above. In some cases, the storage medium might be incorporatedwithin a computer system, such as computer system 2000. In otherembodiments, the storage medium might be separate from a computer system(e.g., a removable medium, such as a compact disc), and/or provided inan installation package, such that the storage medium can be used toprogram, configure and/or adapt a general purpose computer with theinstructions/code stored thereon. These instructions might take the formof executable code, which is executable by the computer system 2000and/or might take the form of source and/or installable code, which,upon compilation and/or installation on the computer system 2000 (e.g.,using any of a variety of generally available compilers, installationprograms, compression/decompression utilities, etc.) then takes the formof executable code.

Substantial variations may be made in accordance with specificrequirements. For example, customized hardware might also be used,and/or particular elements might be implemented in hardware, software(including portable software, such as applets, etc.), or both. Further,connection to other computing devices such as network input/outputdevices may be employed.

Some embodiments may employ a computer system (such as the computersystem 2000) to perform methods in accordance with the disclosure. Forexample, some or all of the procedures of the described methods may beperformed by the computer system 2000 in response to processor 2010executing one or more sequences of one or more instructions (which mightbe incorporated into the operating system 2040 and/or other code, suchas an application program 2045) contained in the working memory 2035.Such instructions may be read into the working memory 2035 from anothercomputer-readable medium, such as one or more of the storage device(s)2025. Merely by way of example, execution of the sequences ofinstructions contained in the working memory 2035 might cause theprocessor(s) 2010 to perform one or more procedures of the methodsdescribed herein, for example a method associated with the modulesdescribed with respect to FIG. 4.

The terms “machine-readable medium” and “computer-readable medium,” asused herein, refer to any medium that participates in providing datathat causes a machine to operate in a specific fashion. In an embodimentimplemented using the computer system 2000, various computer-readablemedia might be involved in providing instructions/code to processor(s)2010 for execution and/or might be used to store and/or carry suchinstructions/code (e.g., as signals). In many implementations, acomputer-readable medium is a physical and/or tangible storage medium.Such a medium may take many forms, including but not limited to,non-volatile media, volatile media, and transmission media. Non-volatilemedia include, for example, optical and/or magnetic disks, such as thestorage device(s) 2025. Volatile media include, without limitation,dynamic memory, such as the working memory 2035. Transmission mediainclude, without limitation, coaxial cables, copper wire and fiberoptics, including the wires that comprise the bus 2005, as well as thevarious components of the communications subsystem 2030 (and/or themedia by which the communications subsystem 2030 provides communicationwith other devices). Hence, transmission media can also take the form ofwaves (including without limitation radio, acoustic and/or light waves,such as those generated during radio-wave and infrared datacommunications).

Common forms of physical and/or tangible computer-readable mediainclude, for example, a floppy disk, a flexible disk, hard disk,magnetic tape, or any other magnetic medium, a CD-ROM, any other opticalmedium, punchcards, papertape, any other physical medium with patternsof holes, a RAM, a PROM, EPROM, a FLASH-EPROM, any other memory chip orcartridge, a carrier wave as described hereinafter, or any other mediumfrom which a computer can read instructions and/or code.

Various forms of computer-readable media may be involved in carrying oneor more sequences of one or more instructions to the processor(s) 2010for execution. Merely by way of example, the instructions may initiallybe carried on a magnetic disk and/or optical disc of a remote computer.A remote computer might load the instructions into its dynamic memoryand send the instructions as signals over a transmission medium to bereceived and/or executed by the computer system 2000. These signals,which might be in the form of electromagnetic signals, acoustic signals,optical signals and/or the like, are all examples of carrier waves onwhich instructions can be encoded, in accordance with variousembodiments of the invention.

The communications subsystem 2030 (and/or components thereof) generallywill receive the signals, and the bus 2005 then might carry the signals(and/or the data, instructions, etc. carried by the signals) to theworking memory 2035, from which the processor(s) 2010 retrieves andexecutes the instructions. The instructions received by the workingmemory 2035 may optionally be stored on a non-transitory storage device2025 either before or after execution by the processor(s) 2010.

The methods, systems, and devices discussed above are examples. Variousembodiments may omit, substitute, or add various procedures orcomponents as appropriate. For instance, in alternative configurations,the methods described may be performed in an order different from thatdescribed, and/or various stages may be added, omitted, and/or combined.Also, features described with respect to certain embodiments may becombined in various other embodiments. Different aspects and elements ofthe embodiments may be combined in a similar manner. Also, technologyevolves and, thus, many of the elements are examples that do not limitthe scope of the disclosure to those specific examples.

Specific details are given in the description to provide a thoroughunderstanding of the embodiments. However, embodiments may be practicedwithout these specific details. For example, well-known circuits,processes, algorithms, structures, and techniques have been shownwithout unnecessary detail in order to avoid obscuring the embodiments.This description provides example embodiments only, and is not intendedto limit the scope, applicability, or configuration of the invention.Rather, the preceding description of the embodiments will provide thoseskilled in the art with an enabling description for implementingembodiments of the invention. Various changes may be made in thefunction and arrangement of elements without departing from the spiritand scope of the invention.

Also, some embodiments were described as processes depicted as flowdiagrams or block diagrams. Although each may describe the operations asa sequential process, many of the operations can be performed inparallel or concurrently. In addition, the order of the operations maybe rearranged. A process may have additional steps not included in thefigure. Furthermore, embodiments of the methods may be implemented byhardware, software, firmware, middleware, microcode, hardwaredescription languages, or any combination thereof. When implemented insoftware, firmware, middleware, or microcode, the program code or codesegments to perform the associated tasks may be stored in acomputer-readable medium such as a storage medium. Processors mayperform the associated tasks.

Having described several embodiments, various modifications, alternativeconstructions, and equivalents may be used without departing from thespirit of the disclosure. For example, the above elements may merely bea component of a larger system, wherein other rules may take precedenceover or otherwise modify the application of the invention. Also, anumber of steps may be undertaken before, during, or after the aboveelements are considered. Accordingly, the above description does notlimit the scope of the disclosure.

What is claimed is:
 1. A method for calibrating a sensor on a mobiledevice, the method comprising: detecting, via a temperature sensorcoupled to the mobile device, temperature of an operating environmentfor a sensor coupled to the mobile device; identifying, via a processorcoupled to the mobile device, a temperature bin from a plurality oftemperature bins for the sensor using the detected temperature, inresponse to detecting temperature of an operating environment for thesensor, wherein the temperature bin comprises a range of temperatures,wherein the temperature bin has one or more sensor measurements receivedat a temperature within the range of temperatures associated with thetemperature bin; determining, via the processor, that diversity amongpreviously stored sensor measurement data at or near the temperature isbelow a threshold; in response to determining that the diversityassociated with the sensor measurement data at or near the temperatureis below the threshold, generating, via the processor, calibration datafor the sensor for the detected temperature using sensor measurementdata from a previously detected temperature, wherein the generatingcomprises using sensor measurement data from another temperature bin;lowering, via the processor, a weight associated with the sensormeasurement data from another temperature bin by adjusting one or moreparameters of a filter associated with the temperature bin; calibrating,via the processor and based at least in part on the generatedcalibration data, output from the sensor at or near the temperature; andoperating, via the processor, the sensor based on the calibrated output.2. The method of claim 1, wherein the sensor is one or more of anaccelerometer, a gyroscope or a magnetometer.
 3. The method of claim 1,wherein the generating comprises linearly interpolating sensormeasurement data for at least one orientation at the temperature bin forthe detected temperature using the sensor measurement data from one ormore adjacent temperature bins to an identified temperature bin.
 4. Themethod of claim 3, wherein linearly interpolating sensor measurementdata comprises using the sensor measurement from one or more adjacenttemperature bins and a pre-determined slope of a change in sensormeasurement data with respect to a change in temperature for derivingthe sensor measurement data for the at least one orientation at thetemperature bin.
 5. The method of claim 1, wherein each temperature binis associated with a respective filter.
 6. The method of claim 1,further comprising updating the sensor measurement data for at least oneorientation at the detected temperature using the sensor measurementdata from another temperature.
 7. The method of claim 1, wherein thecalibration data comprises a sensor offset or a sensitivity.
 8. A mobiledevice for generating calibration data, comprising: a temperature sensorconfigured to detect temperature of an operating environment for asensor coupled to the mobile device; a temperature compensation moduleconfigured to: identify a temperature bin from a plurality oftemperature bins for the sensor using the detected temperature, inresponse to detecting temperature of an operating environment for thesensor, wherein the temperature bin comprises a range of temperatures,wherein the temperature bin has one or more sensor measurements receivedat a temperature within the range of temperatures associated with thetemperature bin; determine that diversity among previously stored sensormeasurement data at or near the temperature is below a threshold;generate calibration data for the sensor for the detected temperatureusing sensor measurement data from a previously detected temperature, inresponse to determining that the diversity associated with the sensormeasurement data at or near the temperature is below the threshold,wherein the generating comprises using sensor measurement data fromanother temperature bin; lower a weight associated with the sensormeasurement data from another temperature bin by adjusting one or moreparameters of a filter associated with the temperature bin; and aprocessor configured to: calibrate, based at least in part on thegenerated calibration data, output from the sensor at or near thetemperature; and operate the sensor based on the calibrated output. 9.The mobile device of claim 8, wherein the sensor is one or more of anaccelerometer, a gyroscope or a magnetometer.
 10. The mobile device ofclaim 8, wherein the generating comprises linearly interpolating sensormeasurement data for at least one orientation at the temperature bin forthe detected temperature using the sensor measurement data from one ormore adjacent temperature bins to an identified temperature bin.
 11. Themobile device of claim 10, wherein linearly interpolating sensormeasurement data comprises using the sensor measurement from one or moreadjacent temperature bins and a pre-determined slope of a change insensor measurement data with respect to a change in temperature forderiving the sensor measurement data for the at least one orientation atthe temperature bin by the temperature compensation module.
 12. Themobile device of claim 8, wherein each temperature bin is associatedwith a respective filter.
 13. The mobile device of claim 8, wherein thetemperature compensation module is further configured to update thesensor measurement data for at least one orientation at the detectedtemperature using the sensor measurement data from another temperature.14. The mobile device of claim 8, wherein the calibration data comprisesa sensor offset or a sensitivity.
 15. A non-transitory computer readablestorage medium, wherein the non-transitory computer readable storagemedium comprises instructions executable by a processor, theinstructions comprising instructions to: detect temperature of anoperating environment for a sensor coupled to a mobile device; identifya temperature bin from a plurality of temperature bins for the sensorusing the detected temperature, in response to detecting temperature ofan operating environment for the sensor, wherein the temperature bincomprises a range of temperatures, wherein the temperature bin has oneor more sensor measurements received at a temperature within the rangeof temperatures associated with the temperature bin; determine thatdiversity among previously stored sensor measurement data at or near thetemperature is below a threshold; generate calibration data for thesensor for the detected temperature using sensor measurement data from apreviously detected temperature, in response to determining that thediversity associated with the sensor measurement data at or near thetemperature is below the threshold, wherein the generating comprisesusing sensor measurement data from another temperature bin; lower aweight associated with the sensor measurement data from anothertemperature bin by adjusting one or more parameters of a filterassociated with the temperature bin; calibrate, based at least in parton the generated calibration data, output from the sensor at or near thetemperature; and operate the sensor based on the calibrated output. 16.An apparatus, comprising: means for detecting temperature of anoperating environment for a sensor coupled to a mobile device; means foridentifying a temperature bin from a plurality of temperature bins forthe sensor using the detected temperature, in response to detectingtemperature of an operating environment for the sensor, wherein thetemperature bin comprises a range of temperatures, wherein thetemperature bin has one or more sensor measurements received at atemperature within the range of temperatures associated with thetemperature bin; means for determining that diversity among previouslystored sensor measurement data at or near the temperature is below athreshold; means for generating calibration data for the sensor for thedetected temperature using sensor measurement data from a previouslydetected temperature, in response to determining that the diversityassociated with the sensor measurement data at or near the temperatureis below the threshold, wherein the generating comprises using sensormeasurement data from another temperature bin; means for lowering aweight associated with the sensor measurement data from anothertemperature bin by adjusting one or more parameters of a filterassociated with the temperature bin; means for calibrating, based atleast in part on the generated calibration data, output from the sensorat or near the temperature; and means for operating the sensor based onthe calibrated output.
 17. The apparatus of claim 16, wherein thegenerating comprises means for linearly interpolating sensor measurementdata for at least one orientation at the temperature bin for thedetected temperature using the sensor measurement data from one or moreadjacent temperature bins to an identified temperature bin.
 18. Theapparatus of claim 17, wherein linearly interpolating sensor measurementdata comprises using the sensor measurement from one or more adjacenttemperature bins and a pre-determined slope of a change in sensormeasurement data with respect to a change in temperature for derivingthe sensor measurement data for the at least one orientation at thetemperature bin.
 19. The apparatus of claim 16, wherein each temperaturebin is associated with a respective filter.
 20. The apparatus of claim16, further comprising means for updating the sensor measurement datafor at least one orientation at the detected temperature using thesensor measurement data from another temperature.
 21. The apparatus ofclaim 16, wherein the calibration data comprises a sensor offset or asensitivity.